类 PrintHelper

java.lang.Object
com.darra.ethercat.statics.PrintHelper

public final class PrintHelper extends Object
描述辅助工具类 提供枚举描述方法 (状态描述、错误描述, 中文)
  • 方法详细资料

    • getStateDescription

      public static String getStateDescription(EcState state)
      获取 EcState 的描述
      参数:
      state - 状态枚举
      返回:
      状态描述字符串
    • formatState

      public static String formatState(int stateValue)
      格式化复合状态 (如 0x14 -> "SafeOp+Error")
      参数:
      stateValue - 状态原始值
      返回:
      格式化的状态字符串
    • getALStatusDescription

      public static String getALStatusDescription(int alStatusCode)
      获取 AL Status Code 描述 (Core.dll 端).
      参数:
      alStatusCode - AL 状态码
      返回:
      描述, 未知时 "Unknown (0xXXXX)"
    • getALStatusDescriptionChinese

      public static String getALStatusDescriptionChinese(int alStatusCode)
      兼容旧 API, 现统一调 Core.dll.
    • getALStatusFullDescription

      public static String getALStatusFullDescription(int alStatusCode)
      兼容旧 API, 现统一调 Core.dll.
    • getALStatusSeverity

      public static int getALStatusSeverity(int alStatusCode)
      AL 状态严重级别 (0=Info, 1=Warning, 2=Error, 3=Fatal).
    • getALStatusRecoveryHint

      public static String getALStatusRecoveryHint(int alStatusCode)
      AL 状态恢复建议 (中文短句).
    • isALStatusVendorSpecific

      public static boolean isALStatusVendorSpecific(int alStatusCode)
      是否厂商特定错误码 (0x8000-0xFFFF).
    • getRedundancyModeDescription

      public static String getRedundancyModeDescription(int mode)
      获取冗余模式描述
      参数:
      mode - 冗余模式 (0=未激活, 1=双向冗余, 2=降级)
      返回:
      中文描述
    • getMailboxTypeDescription

      public static String getMailboxTypeDescription(int mailboxType)
      获取邮箱类型描述
      参数:
      mailboxType - 邮箱类型值
      返回:
      描述字符串
    • getSDOErrorDescription

      public static String getSDOErrorDescription(long sdoErrorCode)
      获取 SDO 错误码描述
      参数:
      sdoErrorCode - SDO 错误码 (32位)
      返回:
      英文描述
    • getSoEErrorDescription

      public static String getSoEErrorDescription(int soeErrorCode)
      获取 SoE 错误码描述
      参数:
      soeErrorCode - SoE 错误码 (16位)
      返回:
      英文描述
    • getMailboxErrorDescription

      public static String getMailboxErrorDescription(int mbxErrorCode)
      获取邮箱错误码描述
      参数:
      mbxErrorCode - 邮箱错误码 (16位)
      返回:
      英文描述
    • getEcLinkStateDescription

      public static String getEcLinkStateDescription(int linkState)
      获取链路状态描述
      参数:
      linkState - 链路状态值
      返回:
      描述字符串
    • getEcDataTypeDescription

      public static String getEcDataTypeDescription(int dataType)
      获取 EcDataType 的描述
      参数:
      dataType - 数据类型代码
      返回:
      数据类型描述 (如 "Integer32")
    • getCommonTypeName

      public static String getCommonTypeName(int dataType)
      获取常用数据类型名称 (用于 UI 显示)
      参数:
      dataType - 数据类型代码
      返回:
      常用类型名 (如 "int32", "float", "string")
    • getCoEObjectAccessDescription

      public static String getCoEObjectAccessDescription(int objAccess)
      获取 CoE 对象访问权限描述 (RWRWRW 格式)
      参数:
      objAccess - 对象访问权限值
      返回:
      位描述字符串, 如 "RW_WRW"
    • getAccessDescriptionChinese

      public static String getAccessDescriptionChinese(int objAccess)
      获取对象访问权限的中文描述
      参数:
      objAccess - 对象访问权限值
      返回:
      中文描述, 如 "读写(PreOP,SafeOP可写)", "只读", "只写", "无权限"
    • getWriteConditionDescription

      public static String getWriteConditionDescription(int objAccess)
      获取写入条件的详细描述
      参数:
      objAccess - 对象访问权限值
      返回:
      写入条件描述, 如 "写入条件: PreOP/SafeOP"
    • getCiA402StateDescription

      public static String getCiA402StateDescription(int stateCode)
      获取 CiA 402 驱动器状态描述
      参数:
      stateCode - 状态码 (0-7)
      返回:
      状态描述 (中英文)
    • getCiA402ModeDescription

      public static String getCiA402ModeDescription(int modeCode)
      获取 CiA 402 操作模式描述
      参数:
      modeCode - 模式码
      返回:
      模式描述 (中英文)
    • getFSoEStateDescription

      public static String getFSoEStateDescription(int state)
      获取 FSoE 状态英文描述
      参数:
      state - FSoE 状态值 (0x100-0x105)
      返回:
      状态描述
    • getFSoEStateDescriptionChinese

      public static String getFSoEStateDescriptionChinese(int state)
      获取 FSoE 状态中文描述
      参数:
      state - FSoE 状态值 (0x100-0x105)
      返回:
      状态中文描述
    • getFSoEErrorDescription

      public static String getFSoEErrorDescription(int error)
      获取 FSoE 错误中文描述
      参数:
      error - FSoE 错误码
      返回:
      错误描述 (中文)
    • getFSoEErrorDescriptionEn

      public static String getFSoEErrorDescriptionEn(int error)
      获取 FSoE 错误英文描述
      参数:
      error - FSoE 错误码
      返回:
      错误描述 (英文)