Ejemplo n.º 1
0
        public List <TDIO_ChannelInfo> DIOQueryChannelList(uint loginid, string devname = "")
        {
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXStreamIOSDKProtocol StrmGetChlInfo loginid:" + loginid + ",devname:" + devname);
            uint pdwQueryChnLstHandle;

            IVXDIOSDKProtocol.DIOCreateQueryChannelList(loginid, out pdwQueryChnLstHandle);
            List <TDIO_ChannelInfo> ret = new List <TDIO_ChannelInfo>();
            StringBuilder           sb  = new StringBuilder();

            while (true)
            {
                TDIO_ChannelInfo info = new TDIO_ChannelInfo();
                uint             pdwQueryOverFlag;
                IVXDIOSDKProtocol.DIOGetNextChannelInfo(pdwQueryChnLstHandle, out info, out pdwQueryOverFlag);

                if (pdwQueryOverFlag == 0)
                {
                    break;
                }
                else
                {
                    info.szRest = loginid.ToString();
                    ret.Add(info);
                    sb.AppendLine("szChannelId:" + info.szChannelId + ",szChannelName:" + info.szChannelName + ",szRest:" + info.szRest);
                }
            }
            IVXDIOSDKProtocol.DIOCloseQueryChannelList(pdwQueryChnLstHandle);

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXStreamIOSDKProtocol StrmGetChlInfo ret:" + 0 + ",list:" + sb.ToString());
            return(ret);
        }
Ejemplo n.º 2
0
        public List <TDIO_ChannelInfo> DIOQueryChannelList(uint loginid, string devname = "")
        {
            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXStreamIOSDKProtocol StrmGetChlInfo loginid:" + loginid + ",devname:" + devname);
            IntPtr ptr    = Marshal.AllocHGlobal(1000);
            uint   ChlNum = 0;

            IVXStreamIOSDKProtocol.StrmGetChlNum(loginid, out ChlNum);
            IntPtr pchlinfo = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CHLSINFO)) * (int)ChlNum);
            uint   retVal   = IVXStreamIOSDKProtocol.StrmGetChlInfo(loginid, ChlNum, pchlinfo);

            if (retVal > 0)
            {
                DIO_GetError(retVal);
            }
            List <TDIO_ChannelInfo> ret = new List <TDIO_ChannelInfo>();
            StringBuilder           sb  = new StringBuilder();

            for (int i = 0; i < ChlNum; i++)
            {
                CHLSINFO         temp = (CHLSINFO)Marshal.PtrToStructure(pchlinfo + Marshal.SizeOf(typeof(CHLSINFO)) * i, typeof(CHLSINFO));
                TDIO_ChannelInfo info = new TDIO_ChannelInfo();
                info.szChannelId   = string.IsNullOrEmpty(devname) ? temp.ChlId : devname + " " + temp.ChlId;
                info.szChannelName = temp.ChlName;
                //info.szRest = temp.Rest;
                info.szRest = loginid.ToString();
                //if (temp.Status == 1)
                ret.Add(info);
                sb.AppendLine("szChannelId:" + info.szChannelId + ",szChannelName:" + info.szChannelName + ",szRest:" + info.szRest);
            }

            MyLog4Net.ILogExtension.DebugWithDebugView(MyLog4Net.Container.Instance.Log, "IVXStreamIOSDKProtocol StrmGetChlInfo ret:" + 0 + ",list:" + sb.ToString());
            return(ret);
        }
Ejemplo n.º 3
0
 public static extern UInt32 DIOGetNextChannelInfo(UInt32 dwQueryChnLstHandle, out TDIO_ChannelInfo ptChannelInfo, out UInt32 pdwQueryOverFlag);