Exemplo n.º 1
0
        /*===========================================================
        *  功  能:获取实时分析信息ByID
        *  参  数:dwLoginID - 登录ID
        *       pdwAnalysisID - 分析ID
        *       tAnalysisInfo - 返回分析信息
        *  返回值:成功返回IASSDK_OK,失败返回错误码
        *  ===========================================================*/
        public RealAnalyseInfo IasSdk_GetRTAnalysisInfoByID(UInt32 dwLoginID, UInt32 dwAnalysisID)
        {
            TIASSDK_REAL_ANALYSIS_INFO ptAnalysisInfo = new TIASSDK_REAL_ANALYSIS_INFO();

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXRealtimeSDKProtocol IasSdk_GetRTAnalysisInfoByID dwLoginID:" + dwLoginID + ",dwAnalysisID:" + dwAnalysisID);
            UInt32          retVal = IVXRealtimeSDKProtocol.IasSdk_GetRTAnalysisInfoByID(dwLoginID, dwAnalysisID, out ptAnalysisInfo);
            RealAnalyseInfo info   = null;

            if (retVal > 0)
            {
                IAS_CheckError(retVal);
            }

            info = new RealAnalyseInfo()
            {
                dwAnalysisID          = ptAnalysisInfo.dwAnalysisID,
                realAnalyseServerInfo = new RealAnalyseServerUnitInfo()
                {
                    dwServerID  = ptAnalysisInfo.dwServerID,
                    szServerIp  = ptAnalysisInfo.szServerIp,
                    wServerPort = ptAnalysisInfo.wServerPort,
                    serverType  = E_IASSDK_SERVER_UNIT_TYPE.E_IASSDK_ANALYSIS_UNIT_UNKNOW,
                },
                realAnalyseParam = new RealAnalyseParam()
                {
                    dwAnalysisPlanID = ptAnalysisInfo.tAnalysisParam.dwAnalysisPlanID,
                    eAlgthmType      = (E_VIDEO_ANALYZE_TYPE)ptAnalysisInfo.tAnalysisParam.eAlgthmType,
                    szAnalysisParam  = ptAnalysisInfo.tAnalysisParam.szAnalysisParam,
                    szArsIp          = ptAnalysisInfo.tAnalysisParam.szArsIp,
                    wArsPort         = ptAnalysisInfo.tAnalysisParam.wArsPort,
                    realCameraInfo   = new RealCameraInfo()
                    {
                        dwDevicePort = ptAnalysisInfo.tAnalysisParam.cNetStoreDevInfo.dwDevicePort,
                        dwDeviceType = ptAnalysisInfo.tAnalysisParam.cNetStoreDevInfo.dwDeviceType,
                        szCameraID   = ptAnalysisInfo.tAnalysisParam.szCameraID,
                        szChannelID  = ptAnalysisInfo.tAnalysisParam.cNetStoreDevInfo.szChannelID,
                        szDeviceIP   = ptAnalysisInfo.tAnalysisParam.cNetStoreDevInfo.szDeviceIP,
                        szLoginPwd   = ptAnalysisInfo.tAnalysisParam.cNetStoreDevInfo.szLoginPwd,
                        szLoginUser  = ptAnalysisInfo.tAnalysisParam.cNetStoreDevInfo.szLoginUser,
                    },
                },
                dwConSerialNum = ptAnalysisInfo.dwConSerialNum,
                eStatusType    = (E_IASSDK_REAL_ANALYZE_STATUS_TYPE)ptAnalysisInfo.eStatusType,
            };
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, string.Format("IVXRealtimeSDKProtocol IasSdk_GetRTAnalysisInfoByID ret:{0}"
                                                                                                       + ",dwAnalysisID:{1}"
                                                                                                       + ",dwServerID:{2}"
                                                                                                       + ",szServerIp:{3}"
                                                                                                       + ",wServerPort:{4}"
                                                                                                       + ",serverType:{5}"
                                                                                                       + ",dwAnalysisPlanID:{6}"
                                                                                                       + ",eAlgthmType:{7}"
                                                                                                       + ",szAnalysisParam:{8}"
                                                                                                       + ",szArsIp:{9}"
                                                                                                       + ",wArsPort:{10}"
                                                                                                       + ",dwDevicePort:{11}"
                                                                                                       + ",dwDeviceType:{12}"
                                                                                                       + ",szCameraID:{13}"
                                                                                                       + ",szChannelID:{14}"
                                                                                                       + ",szDeviceIP:{15}"
                                                                                                       + ",szLoginPwd:{16}"
                                                                                                       + ",szLoginUser:{17}"
                                                                                                       + ",dwConSerialNum:{18}"
                                                                                                       + ",eStatusType:{19}"
                                                                                                       , retVal
                                                                                                       , info.dwAnalysisID
                                                                                                       , info.realAnalyseServerInfo.dwServerID
                                                                                                       , info.realAnalyseServerInfo.szServerIp
                                                                                                       , info.realAnalyseServerInfo.wServerPort
                                                                                                       , info.realAnalyseServerInfo.serverType
                                                                                                       , info.realAnalyseParam.dwAnalysisPlanID
                                                                                                       , info.realAnalyseParam.eAlgthmType
                                                                                                       , info.realAnalyseParam.szAnalysisParam
                                                                                                       , info.realAnalyseParam.szArsIp
                                                                                                       , info.realAnalyseParam.wArsPort
                                                                                                       , info.realAnalyseParam.realCameraInfo.dwDevicePort
                                                                                                       , info.realAnalyseParam.realCameraInfo.dwDeviceType
                                                                                                       , info.realAnalyseParam.realCameraInfo.szCameraID
                                                                                                       , info.realAnalyseParam.realCameraInfo.szChannelID
                                                                                                       , info.realAnalyseParam.realCameraInfo.szDeviceIP
                                                                                                       , info.realAnalyseParam.realCameraInfo.szLoginPwd
                                                                                                       , info.realAnalyseParam.realCameraInfo.szLoginUser
                                                                                                       , info.dwConSerialNum
                                                                                                       , info.eStatusType
                                                                                                       ));

            return(info);
        }
Exemplo n.º 2
0
        /*===========================================================
        *  功  能:获取实时分析信息ByNum
        *  参  数:dwLoginID - 登录ID
        *       dwMaxNum - 传入需要获取的数量
        *       pdwAnalysisNum - 返回实际得到的分析数量
        *       ptAnalysisInfo - 返回分析信息指针
        *  返回值:成功返回IASSDK_OK,失败返回错误码
        *  ===========================================================*/
        public List <RealAnalyseInfo> IasSdk_GetRTAnalysisList(UInt32 dwLoginID, UInt32 dwMaxNum)
        {
            UInt32 pdwAnalysisNum = 0;
            IntPtr ptAnalysisInfo = Marshal.AllocHGlobal((int)(Marshal.SizeOf(typeof(TIASSDK_REAL_ANALYSIS_INFO)) * dwMaxNum)); /*OUT TIASSDK_REAL_ANALYSIS_INFO * */

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXRealtimeSDKProtocol IasSdk_GetRTAnalysisList dwLoginID:" + dwLoginID + ",dwMaxNum:" + dwMaxNum);
            UInt32 retVal = IVXRealtimeSDKProtocol.IasSdk_GetRTAnalysisList(dwLoginID, dwMaxNum, out pdwAnalysisNum, ptAnalysisInfo);
            List <RealAnalyseInfo> infolist = new List <RealAnalyseInfo>();

            if (retVal > 0)
            {
                IAS_CheckError(retVal);
            }
            for (int i = 0; i < pdwAnalysisNum; i++)
            {
                TIASSDK_REAL_ANALYSIS_INFO temp = (TIASSDK_REAL_ANALYSIS_INFO)Marshal.PtrToStructure(ptAnalysisInfo + i * Marshal.SizeOf(typeof(TIASSDK_REAL_ANALYSIS_INFO)), typeof(TIASSDK_REAL_ANALYSIS_INFO));
                RealAnalyseInfo            info = new RealAnalyseInfo()
                {
                    dwAnalysisID          = temp.dwAnalysisID,
                    realAnalyseServerInfo = new RealAnalyseServerUnitInfo()
                    {
                        dwServerID  = temp.dwServerID,
                        szServerIp  = temp.szServerIp,
                        wServerPort = temp.wServerPort,
                        serverType  = E_IASSDK_SERVER_UNIT_TYPE.E_IASSDK_ANALYSIS_UNIT_UNKNOW,
                    },
                    realAnalyseParam = new RealAnalyseParam()
                    {
                        dwAnalysisPlanID = temp.tAnalysisParam.dwAnalysisPlanID,
                        eAlgthmType      = (E_VIDEO_ANALYZE_TYPE)temp.tAnalysisParam.eAlgthmType,
                        szAnalysisParam  = temp.tAnalysisParam.szAnalysisParam,
                        szArsIp          = temp.tAnalysisParam.szArsIp,
                        wArsPort         = temp.tAnalysisParam.wArsPort,
                        realCameraInfo   = new RealCameraInfo()
                        {
                            dwDevicePort = temp.tAnalysisParam.cNetStoreDevInfo.dwDevicePort,
                            dwDeviceType = temp.tAnalysisParam.cNetStoreDevInfo.dwDeviceType,
                            szCameraID   = temp.tAnalysisParam.szCameraID,
                            szChannelID  = temp.tAnalysisParam.cNetStoreDevInfo.szChannelID,
                            szDeviceIP   = temp.tAnalysisParam.cNetStoreDevInfo.szDeviceIP,
                            szLoginPwd   = temp.tAnalysisParam.cNetStoreDevInfo.szLoginPwd,
                            szLoginUser  = temp.tAnalysisParam.cNetStoreDevInfo.szLoginUser,
                        },
                    },
                    dwConSerialNum = temp.dwConSerialNum,
                    eStatusType    = (E_IASSDK_REAL_ANALYZE_STATUS_TYPE)temp.eStatusType,
                };
                MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, string.Format("IVXRealtimeSDKProtocol IasSdk_GetRTAnalysisList [{0}]"
                                                                                                           + ",dwAnalysisID:{1}"
                                                                                                           + ",dwServerID:{2}"
                                                                                                           + ",szServerIp:{3}"
                                                                                                           + ",wServerPort:{4}"
                                                                                                           + ",serverType:{5}"
                                                                                                           + ",dwAnalysisPlanID:{6}"
                                                                                                           + ",eAlgthmType:{7}"
                                                                                                           + ",szAnalysisParam:{8}"
                                                                                                           + ",szArsIp:{9}"
                                                                                                           + ",wArsPort:{10}"
                                                                                                           + ",dwDevicePort:{11}"
                                                                                                           + ",dwDeviceType:{12}"
                                                                                                           + ",szCameraID:{13}"
                                                                                                           + ",szChannelID:{14}"
                                                                                                           + ",szDeviceIP:{15}"
                                                                                                           + ",szLoginPwd:{16}"
                                                                                                           + ",szLoginUser:{17}"
                                                                                                           + ",dwConSerialNum:{18}"
                                                                                                           + ",eStatusType:{19}"
                                                                                                           , i
                                                                                                           , info.dwAnalysisID
                                                                                                           , info.realAnalyseServerInfo.dwServerID
                                                                                                           , info.realAnalyseServerInfo.szServerIp
                                                                                                           , info.realAnalyseServerInfo.wServerPort
                                                                                                           , info.realAnalyseServerInfo.serverType
                                                                                                           , info.realAnalyseParam.dwAnalysisPlanID
                                                                                                           , info.realAnalyseParam.eAlgthmType
                                                                                                           , info.realAnalyseParam.szAnalysisParam
                                                                                                           , info.realAnalyseParam.szArsIp
                                                                                                           , info.realAnalyseParam.wArsPort
                                                                                                           , info.realAnalyseParam.realCameraInfo.dwDevicePort
                                                                                                           , info.realAnalyseParam.realCameraInfo.dwDeviceType
                                                                                                           , info.realAnalyseParam.realCameraInfo.szCameraID
                                                                                                           , info.realAnalyseParam.realCameraInfo.szChannelID
                                                                                                           , info.realAnalyseParam.realCameraInfo.szDeviceIP
                                                                                                           , info.realAnalyseParam.realCameraInfo.szLoginPwd
                                                                                                           , info.realAnalyseParam.realCameraInfo.szLoginUser
                                                                                                           , info.dwConSerialNum
                                                                                                           , info.eStatusType
                                                                                                           ));

                infolist.Add(info);
            }
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXRealtimeSDKProtocol IasSdk_GetRTAnalysisList ret:" + retVal);
            return(infolist);
        }
Exemplo n.º 3
0
 public static extern UInt32 IasSdk_GetRTAnalysisInfoByID(UInt32 dwLoginID, UInt32 dwAnalysisID, out TIASSDK_REAL_ANALYSIS_INFO ptAnalysisInfo);