类 PrintHelper
java.lang.Object
com.darra.ethercat.statics.PrintHelper
描述辅助工具类
提供枚举描述方法 (状态描述、错误描述, 中文)
-
方法概要
修饰符和类型方法说明static StringformatState(int stateValue) 格式化复合状态 (如 0x14 -> "SafeOp+Error")static StringgetAccessDescriptionChinese(int objAccess) 获取对象访问权限的中文描述static StringgetALStatusDescription(int alStatusCode) 获取 AL Status Code 描述 (Core.dll 端).static StringgetALStatusDescriptionChinese(int alStatusCode) 兼容旧 API, 现统一调 Core.dll.static StringgetALStatusFullDescription(int alStatusCode) 兼容旧 API, 现统一调 Core.dll.static StringgetALStatusRecoveryHint(int alStatusCode) AL 状态恢复建议 (中文短句).static intgetALStatusSeverity(int alStatusCode) AL 状态严重级别 (0=Info, 1=Warning, 2=Error, 3=Fatal).static StringgetCiA402ModeDescription(int modeCode) 获取 CiA 402 操作模式描述static StringgetCiA402StateDescription(int stateCode) 获取 CiA 402 驱动器状态描述static StringgetCoEObjectAccessDescription(int objAccess) 获取 CoE 对象访问权限描述 (RWRWRW 格式)static StringgetCommonTypeName(int dataType) 获取常用数据类型名称 (用于 UI 显示)static StringgetEcDataTypeDescription(int dataType) 获取 EcDataType 的描述static StringgetEcLinkStateDescription(int linkState) 获取链路状态描述static StringgetFSoEErrorDescription(int error) 获取 FSoE 错误中文描述static StringgetFSoEErrorDescriptionEn(int error) 获取 FSoE 错误英文描述static StringgetFSoEStateDescription(int state) 获取 FSoE 状态英文描述static StringgetFSoEStateDescriptionChinese(int state) 获取 FSoE 状态中文描述static StringgetMailboxErrorDescription(int mbxErrorCode) 获取邮箱错误码描述static StringgetMailboxTypeDescription(int mailboxType) 获取邮箱类型描述static StringgetRedundancyModeDescription(int mode) 获取冗余模式描述static StringgetSDOErrorDescription(long sdoErrorCode) 获取 SDO 错误码描述static StringgetSoEErrorDescription(int soeErrorCode) 获取 SoE 错误码描述static StringgetStateDescription(EcState state) 获取 EcState 的描述static StringgetWriteConditionDescription(int objAccess) 获取写入条件的详细描述static booleanisALStatusVendorSpecific(int alStatusCode) 是否厂商特定错误码 (0x8000-0xFFFF).
-
方法详细资料
-
getStateDescription
获取 EcState 的描述- 参数:
state- 状态枚举- 返回:
- 状态描述字符串
-
formatState
格式化复合状态 (如 0x14 -> "SafeOp+Error")- 参数:
stateValue- 状态原始值- 返回:
- 格式化的状态字符串
-
getALStatusDescription
获取 AL Status Code 描述 (Core.dll 端).- 参数:
alStatusCode- AL 状态码- 返回:
- 描述, 未知时 "Unknown (0xXXXX)"
-
getALStatusDescriptionChinese
兼容旧 API, 现统一调 Core.dll. -
getALStatusFullDescription
兼容旧 API, 现统一调 Core.dll. -
getALStatusSeverity
public static int getALStatusSeverity(int alStatusCode) AL 状态严重级别 (0=Info, 1=Warning, 2=Error, 3=Fatal). -
getALStatusRecoveryHint
AL 状态恢复建议 (中文短句). -
isALStatusVendorSpecific
public static boolean isALStatusVendorSpecific(int alStatusCode) 是否厂商特定错误码 (0x8000-0xFFFF). -
getRedundancyModeDescription
获取冗余模式描述- 参数:
mode- 冗余模式 (0=未激活, 1=双向冗余, 2=降级)- 返回:
- 中文描述
-
getMailboxTypeDescription
获取邮箱类型描述- 参数:
mailboxType- 邮箱类型值- 返回:
- 描述字符串
-
getSDOErrorDescription
获取 SDO 错误码描述- 参数:
sdoErrorCode- SDO 错误码 (32位)- 返回:
- 英文描述
-
getSoEErrorDescription
获取 SoE 错误码描述- 参数:
soeErrorCode- SoE 错误码 (16位)- 返回:
- 英文描述
-
getMailboxErrorDescription
获取邮箱错误码描述- 参数:
mbxErrorCode- 邮箱错误码 (16位)- 返回:
- 英文描述
-
getEcLinkStateDescription
获取链路状态描述- 参数:
linkState- 链路状态值- 返回:
- 描述字符串
-
getEcDataTypeDescription
获取 EcDataType 的描述- 参数:
dataType- 数据类型代码- 返回:
- 数据类型描述 (如 "Integer32")
-
getCommonTypeName
获取常用数据类型名称 (用于 UI 显示)- 参数:
dataType- 数据类型代码- 返回:
- 常用类型名 (如 "int32", "float", "string")
-
getCoEObjectAccessDescription
获取 CoE 对象访问权限描述 (RWRWRW 格式)- 参数:
objAccess- 对象访问权限值- 返回:
- 位描述字符串, 如 "RW_WRW"
-
getAccessDescriptionChinese
获取对象访问权限的中文描述- 参数:
objAccess- 对象访问权限值- 返回:
- 中文描述, 如 "读写(PreOP,SafeOP可写)", "只读", "只写", "无权限"
-
getWriteConditionDescription
获取写入条件的详细描述- 参数:
objAccess- 对象访问权限值- 返回:
- 写入条件描述, 如 "写入条件: PreOP/SafeOP"
-
getCiA402StateDescription
获取 CiA 402 驱动器状态描述- 参数:
stateCode- 状态码 (0-7)- 返回:
- 状态描述 (中英文)
-
getCiA402ModeDescription
获取 CiA 402 操作模式描述- 参数:
modeCode- 模式码- 返回:
- 模式描述 (中英文)
-
getFSoEStateDescription
获取 FSoE 状态英文描述- 参数:
state- FSoE 状态值 (0x100-0x105)- 返回:
- 状态描述
-
getFSoEStateDescriptionChinese
获取 FSoE 状态中文描述- 参数:
state- FSoE 状态值 (0x100-0x105)- 返回:
- 状态中文描述
-
getFSoEErrorDescription
获取 FSoE 错误中文描述- 参数:
error- FSoE 错误码- 返回:
- 错误描述 (中文)
-
getFSoEErrorDescriptionEn
获取 FSoE 错误英文描述- 参数:
error- FSoE 错误码- 返回:
- 错误描述 (英文)
-