|
@@ -15,95 +15,97 @@ using FileManager;
|
|
|
|
|
|
namespace SmartSEMControl
|
|
|
{
|
|
|
- public enum ZeissErrorCode
|
|
|
- {
|
|
|
- // Failed to translate parameter into an id
|
|
|
- API_E_GET_TRANSLATE_FAIL = 1000,
|
|
|
- // Failed to get analogue value
|
|
|
- API_E_GET_AP_FAIL = 1001,
|
|
|
- // Failed to get digital value
|
|
|
- API_E_GET_DP_FAIL = 1002,
|
|
|
- // Parameter supplied is not analogue nor digital
|
|
|
- API_E_GET_BAD_PARAMETER = 1003,
|
|
|
- // Failed to translate parameter into an id
|
|
|
- API_E_SET_TRANSLATE_FAIL = 1004,
|
|
|
- // Failed to set a digital state
|
|
|
- API_E_SET_STATE_FAIL = 1005,
|
|
|
- // Failed to set a float value
|
|
|
- API_E_SET_FLOAT_FAIL = 1006,
|
|
|
- // Value supplied is too low
|
|
|
- API_E_SET_FLOAT_LIMIT_LOW = 1007,
|
|
|
- // Value supplied is too high
|
|
|
- API_E_SET_FLOAT_LIMIT_HIGH = 1008,
|
|
|
- // Value supplied is is of wrong type
|
|
|
- API_E_SET_BAD_VALUE = 1009,
|
|
|
- // Parameter supplied is not analogue nor digital
|
|
|
- API_E_SET_BAD_PARAMETER = 1010,
|
|
|
- // Failed to translate command into an id
|
|
|
- API_E_EXEC_TRANSLATE_FAIL = 1011,
|
|
|
- // Failed to execute command=
|
|
|
- API_E_EXEC_CMD_FAIL = 1012,
|
|
|
- // Failed to execute file macro
|
|
|
- API_E_EXEC_MCF_FAIL = 1013,
|
|
|
- // Failed to execute library macro
|
|
|
- API_E_EXEC_MCL_FAIL = 1014,
|
|
|
- // Command supplied is not implemented
|
|
|
- API_E_EXEC_BAD_COMMAND = 1015,
|
|
|
- // Grab command failed
|
|
|
- API_E_GRAB_FAIL = 1016,
|
|
|
- // Get Stage position failed
|
|
|
- API_E_GET_STAGE_FAIL = 1017,
|
|
|
- // Move Stage position failed
|
|
|
- API_E_MOVE_STAGE_FAIL = 1018,
|
|
|
- // API not initialised
|
|
|
- API_E_NOT_INITIALISED = 1019,
|
|
|
- // Failed to translate parameter to an id
|
|
|
- API_E_NOTIFY_TRANSLATE_FAIL = 1020,
|
|
|
- // Set notification failed
|
|
|
- API_E_NOTIFY_SET_FAIL = 1021,
|
|
|
- // Get limits failed
|
|
|
- API_E_GET_LIMITS_FAIL = 1022,
|
|
|
- // Get multiple parameters failed
|
|
|
- API_E_GET_MULTI_FAIL = 1023,
|
|
|
- // Set multiple parameters failed
|
|
|
- API_E_SET_MULTI_FAIL = 1024,
|
|
|
- // Missing API license
|
|
|
- API_E_NOT_LICENSED = 1025,
|
|
|
- // Reserved or not implemented
|
|
|
- API_E_NOT_IMPLEMENTED = 1026,
|
|
|
- // Failed to get user name (Remoting Interface only)
|
|
|
- API_E_GET_USER_NAME_FAIL = 1027,
|
|
|
- // Failed to get user idle state (Remoting Interface only)
|
|
|
- API_E_GET_USER_IDLE_FAIL = 1028,
|
|
|
- // Failed to get the last remoting connection error string (Remoting Interface Only)
|
|
|
- API_E_GET_LAST_REMOTING_CONNECT_ERROR_FAIL = 1029,
|
|
|
- // Failed to remotely logon to the EM Server (username and password may be incorrect or EM Server is not running or User is already logged on
|
|
|
- API_E_EMSERVER_LOGON_FAILED = 1030,
|
|
|
- // Failed to start the EM Server - this may be because the Server is already running or has an internal error.
|
|
|
- API_E_EMSERVER_START_FAILED = 1031,
|
|
|
- // The command or parameter is currently disabled (you cannot execute or set it).
|
|
|
- API_E_PARAMETER_IS_DISABLED = 1032,
|
|
|
- // Remoting incorrectly configured, use RConfigure to correct
|
|
|
- API_E_REMOTING_NOT_CONFIGURED = 2027,
|
|
|
- // Remoting did not connect to the server
|
|
|
- API_E_REMOTING_FAILED_TO_CONNECT = 2028,
|
|
|
- // Remoting could not start (unknown reason)
|
|
|
- API_E_REMOTING_COULD_NOT_CREATE_INTERFACE = 2029,
|
|
|
- // Remoting: Remote server is not running currently.
|
|
|
- API_E_REMOTING_EMSERVER_NOT_RUNNING = 2030,
|
|
|
- // Remoting: Remote server has no user logged in
|
|
|
- API_E_REMOTING_NO_USER_LOGGED_IN = 2031,
|
|
|
-
|
|
|
- // Internal Defines, although they may be useful in your own program. TRS.
|
|
|
- API_FIRST_REMOTING_ERROR_CODE = API_E_REMOTING_NOT_CONFIGURED,
|
|
|
- API_LAST_REMOTING_ERROR_CODE = API_E_REMOTING_NO_USER_LOGGED_IN,
|
|
|
- API_FIRST_ERROR_CODE = API_E_GET_TRANSLATE_FAIL,
|
|
|
- API_LAST_ERROR_CODE = API_E_REMOTING_NO_USER_LOGGED_IN
|
|
|
- }
|
|
|
-
|
|
|
//可能遇到的错误提示部分??在log加入之后添加
|
|
|
class SmartSEM : ISEMControl
|
|
|
{
|
|
|
+ #region 返回错误代码枚举
|
|
|
+ private enum ZeissErrorCode
|
|
|
+ {
|
|
|
+ // Failed to translate parameter into an id
|
|
|
+ API_E_GET_TRANSLATE_FAIL = 1000,
|
|
|
+ // Failed to get analogue value
|
|
|
+ API_E_GET_AP_FAIL = 1001,
|
|
|
+ // Failed to get digital value
|
|
|
+ API_E_GET_DP_FAIL = 1002,
|
|
|
+ // Parameter supplied is not analogue nor digital
|
|
|
+ API_E_GET_BAD_PARAMETER = 1003,
|
|
|
+ // Failed to translate parameter into an id
|
|
|
+ API_E_SET_TRANSLATE_FAIL = 1004,
|
|
|
+ // Failed to set a digital state
|
|
|
+ API_E_SET_STATE_FAIL = 1005,
|
|
|
+ // Failed to set a float value
|
|
|
+ API_E_SET_FLOAT_FAIL = 1006,
|
|
|
+ // Value supplied is too low
|
|
|
+ API_E_SET_FLOAT_LIMIT_LOW = 1007,
|
|
|
+ // Value supplied is too high
|
|
|
+ API_E_SET_FLOAT_LIMIT_HIGH = 1008,
|
|
|
+ // Value supplied is is of wrong type
|
|
|
+ API_E_SET_BAD_VALUE = 1009,
|
|
|
+ // Parameter supplied is not analogue nor digital
|
|
|
+ API_E_SET_BAD_PARAMETER = 1010,
|
|
|
+ // Failed to translate command into an id
|
|
|
+ API_E_EXEC_TRANSLATE_FAIL = 1011,
|
|
|
+ // Failed to execute command=
|
|
|
+ API_E_EXEC_CMD_FAIL = 1012,
|
|
|
+ // Failed to execute file macro
|
|
|
+ API_E_EXEC_MCF_FAIL = 1013,
|
|
|
+ // Failed to execute library macro
|
|
|
+ API_E_EXEC_MCL_FAIL = 1014,
|
|
|
+ // Command supplied is not implemented
|
|
|
+ API_E_EXEC_BAD_COMMAND = 1015,
|
|
|
+ // Grab command failed
|
|
|
+ API_E_GRAB_FAIL = 1016,
|
|
|
+ // Get Stage position failed
|
|
|
+ API_E_GET_STAGE_FAIL = 1017,
|
|
|
+ // Move Stage position failed
|
|
|
+ API_E_MOVE_STAGE_FAIL = 1018,
|
|
|
+ // API not initialised
|
|
|
+ API_E_NOT_INITIALISED = 1019,
|
|
|
+ // Failed to translate parameter to an id
|
|
|
+ API_E_NOTIFY_TRANSLATE_FAIL = 1020,
|
|
|
+ // Set notification failed
|
|
|
+ API_E_NOTIFY_SET_FAIL = 1021,
|
|
|
+ // Get limits failed
|
|
|
+ API_E_GET_LIMITS_FAIL = 1022,
|
|
|
+ // Get multiple parameters failed
|
|
|
+ API_E_GET_MULTI_FAIL = 1023,
|
|
|
+ // Set multiple parameters failed
|
|
|
+ API_E_SET_MULTI_FAIL = 1024,
|
|
|
+ // Missing API license
|
|
|
+ API_E_NOT_LICENSED = 1025,
|
|
|
+ // Reserved or not implemented
|
|
|
+ API_E_NOT_IMPLEMENTED = 1026,
|
|
|
+ // Failed to get user name (Remoting Interface only)
|
|
|
+ API_E_GET_USER_NAME_FAIL = 1027,
|
|
|
+ // Failed to get user idle state (Remoting Interface only)
|
|
|
+ API_E_GET_USER_IDLE_FAIL = 1028,
|
|
|
+ // Failed to get the last remoting connection error string (Remoting Interface Only)
|
|
|
+ API_E_GET_LAST_REMOTING_CONNECT_ERROR_FAIL = 1029,
|
|
|
+ // Failed to remotely logon to the EM Server (username and password may be incorrect or EM Server is not running or User is already logged on
|
|
|
+ API_E_EMSERVER_LOGON_FAILED = 1030,
|
|
|
+ // Failed to start the EM Server - this may be because the Server is already running or has an internal error.
|
|
|
+ API_E_EMSERVER_START_FAILED = 1031,
|
|
|
+ // The command or parameter is currently disabled (you cannot execute or set it).
|
|
|
+ API_E_PARAMETER_IS_DISABLED = 1032,
|
|
|
+ // Remoting incorrectly configured, use RConfigure to correct
|
|
|
+ API_E_REMOTING_NOT_CONFIGURED = 2027,
|
|
|
+ // Remoting did not connect to the server
|
|
|
+ API_E_REMOTING_FAILED_TO_CONNECT = 2028,
|
|
|
+ // Remoting could not start (unknown reason)
|
|
|
+ API_E_REMOTING_COULD_NOT_CREATE_INTERFACE = 2029,
|
|
|
+ // Remoting: Remote server is not running currently.
|
|
|
+ API_E_REMOTING_EMSERVER_NOT_RUNNING = 2030,
|
|
|
+ // Remoting: Remote server has no user logged in
|
|
|
+ API_E_REMOTING_NO_USER_LOGGED_IN = 2031,
|
|
|
+
|
|
|
+ // Internal Defines, although they may be useful in your own program. TRS.
|
|
|
+ API_FIRST_REMOTING_ERROR_CODE = API_E_REMOTING_NOT_CONFIGURED,
|
|
|
+ API_LAST_REMOTING_ERROR_CODE = API_E_REMOTING_NO_USER_LOGGED_IN,
|
|
|
+ API_FIRST_ERROR_CODE = API_E_GET_TRANSLATE_FAIL,
|
|
|
+ API_LAST_ERROR_CODE = API_E_REMOTING_NO_USER_LOGGED_IN
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
+
|
|
|
#region 固定参数
|
|
|
private String ELYPATH= @"C:\ProgramData\Carl Zeiss\SmartFIB\API\Drop\";
|
|
|
private String ELYFILENAME = "ApiLayout.ely";
|