• h3c imos(V1.08) 获取当前监视器实况及轮切信息


    /**
    * 分页查询建立在设备(摄像机、监视器、播放器窗格)上的实时监控记录 \n
    * @param [IN]   pstUserLoginIDInfo      用户登录ID信息标识
    * @param [IN]   ulUAType                设备类型,取值范围见#IMOS_TYPE_E
    * @param [IN]   szUACode                摄像机/监视器/窗格编码
    * @param [IN]   pstQueryCondition       通用查询条件
    * @param [IN]   pstQueryPageInfo        请求分页信息
    * @param [OUT]  pstRspPageInfo          响应分页信息
    * @param [OUT]  pstMonitorUnit          实时监控记录列表
    * @return 返回如下结果:
    * - 成功:
    * - #ERR_COMMON_SUCCEED
    * - 失败:
    * - #ERR_AS_MONITOR_NOT_EXIST
    * - #ERR_AS_CAMERA_NOT_EXIST
    * -     返回操作结果码:见结果码文件sdk_err.h
    * @note 无
    */
    IMOS_EXPORT ULONG STDCALL IMOS_QueryMonitorRecordUnderUA
    (
        IN  USER_LOGIN_ID_INFO_S        *pstUserLoginIDInfo,
        IN  ULONG                       ulUAType,
        IN  CHAR                        szUACode[IMOS_RES_CODE_LEN],
        IN  COMMON_QUERY_CONDITION_S    *pstQueryCondition,
        IN  QUERY_PAGE_INFO_S           *pstQueryPageInfo,
        OUT RSP_PAGE_INFO_S             *pstRspPageInfo,
        OUT MONITOR_UNIT_S              *pstMonitorUnit
    );
    View Code
    byte[] szMonitorCode = CommonUtils.StringToByteArray(lblCode.Text, "UTF-8", ConstInfo.IMOS_RES_CODE_LEN);
                    COMMON_QUERY_CONDITION_S common_query_condition = new COMMON_QUERY_CONDITION_S();
                    QUERY_PAGE_INFO_S query_page_info = new QUERY_PAGE_INFO_S();
                    query_page_info.ulPageFirstRowNumber = 0;
                    query_page_info.ulPageRowNum = 30;
                    RSP_PAGE_INFO_S rsp_page_info = new RSP_PAGE_INFO_S();//返回分页信息
                    MONITOR_UNIT_S monitor_unit = new MONITOR_UNIT_S();
                    uint result = H3CNetSDK.IMOS_QueryMonitorRecordUnderUA(
                                ref Global.global_login_info_s.stUserLoginIDInfo,
                                (uint)IMOS_TYPE_E.IMOS_TYPE_MONITOR,
                                szMonitorCode,
                                ref common_query_condition,
                                ref query_page_info,
                                out rsp_page_info,
                                out monitor_unit
                       );
                    if (result != ConstInfo.RESULT_SUCCESS)
                    {
                        throw new ArgumentException(GetResultMsg(result));
                    }
    View Code

    上述方法获取当前监视器实况信息,

    根据monitor_unit.ulTopSrvType判断是否为实况、轮切...等

    如为轮切资源,根据monitor_unit.szMonitorCode调用如下方法可获取轮切信息

    /**
    * 查询监视器上正在轮切的轮切资源信息 \n
    * @param [IN]   pstUserLoginIDInfo      用户登录ID信息标识
    * @param [IN]   szMonitorCode           在硬解实况中为监视器编码; 在软解实况中为窗格编码
    * @param [IN]   pstQueryPageInfo        请求分页信息
    * @param [OUT]  pstRspPageInfo          响应分页信息
    * @param [OUT]  pstSwitchResBase        轮切资源基本信息
    * @param [OUT]  pstSwitchResUnit        轮切资源单元信息列表
    * @return 返回如下结果:
    * - 成功:
    * - #ERR_COMMON_SUCCEED
    * -     返回操作结果码:见结果码文件sdk_err.h
    * @note 无
    */
    IMOS_EXPORT ULONG STDCALL IMOS_QuerySwitchResInfoUnderScreen
    (
        IN   USER_LOGIN_ID_INFO_S       *pstUserLoginIDInfo,
        IN   CHAR                       szMonitorCode[IMOS_RES_CODE_LEN],
        IN   QUERY_PAGE_INFO_S          *pstQueryPageInfo,
        OUT  RSP_PAGE_INFO_S            *pstRspPageInfo,
        OUT  SWITCH_RES_BASE_S          *pstSwitchResBase,
        OUT  SWITCH_RES_UNIT_S          *pstSwitchResUnit
    );
    View Code
    QUERY_PAGE_INFO_S query_page_info = new QUERY_PAGE_INFO_S();
                query_page_info.ulPageFirstRowNumber = 0;
                query_page_info.ulPageRowNum = 1;
                IntPtr ptr_res_page = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(RSP_PAGE_INFO_S)));
                IntPtr ptr_switch_base = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SWITCH_RES_BASE_S)));
                IntPtr ptr_switch_unit = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SWITCH_RES_UNIT_S)));
                try
                {
                    uint result = H3CNetSDK.IMOS_QuerySwitchResInfoUnderScreen(
                                ref Global.global_login_info_s.stUserLoginIDInfo,
                                szMonitorCode,
                                ref query_page_info,
                                ptr_res_page,
                                ptr_switch_base,
                                ptr_switch_unit
                       );
                    IList<RSP_PAGE_INFO_S> lst_result_res_page = CommonUtils.MarshalPtrToStructArray<RSP_PAGE_INFO_S>(ptr_res_page, 1);
                    IList<SWITCH_RES_BASE_S> lst_result_switch_base = CommonUtils.MarshalPtrToStructArray<SWITCH_RES_BASE_S>(ptr_switch_base, 1);
                    IList<SWITCH_RES_UNIT_S> lst_result_switch_unit = CommonUtils.MarshalPtrToStructArray<SWITCH_RES_UNIT_S>(ptr_switch_unit, 1);
                    if (result != ConstInfo.RESULT_SUCCESS)
                    {
                        throw new ArgumentException(GetResultMsg(result));
                    }
                    return lst_result_switch_base;
                }
                finally
                {
                    Marshal.FreeHGlobal(ptr_res_page);
                    Marshal.FreeHGlobal(ptr_switch_base);
                    Marshal.FreeHGlobal(ptr_switch_unit);
                }
    View Code

    上述两个接口是

      SDK不对外发布的函数接口,注意: 其中分页查询时,所需列表空间由外部申请,大小根据分页查询时一页的个数进行申请。

      

  • 相关阅读:
    使用paramiko的问题记录
    python常见异常及解决方法
    linux ps -aux各列含义
    常用技能
    超时程序管理
    跨年的总结和展望
    java json和对象互转
    一些常用功能总结
    ResultSet转成java类对象
    python常用功能总结
  • 原文地址:https://www.cnblogs.com/yishion/p/3097572.html
Copyright © 2020-2023  润新知