Exemplo n.º 1
0
        public void 接收分析仪数据()
        {
            int   len  = 0;
            int   vlen = 0;
            int   id   = 0;
            float d    = 0;
            int   t    = 0;

            byte[] bytes = new byte[2000];
            while (true)
            {
                len = DLL解析源.readDataWFrom(ref bytes[0], 2000, ip);
                if (len > 0)
                {
                    vlen = (len - 4) / 16;

                    for (int i = 0; i < vlen; i++)
                    {
                        id = (int)System.BitConverter.ToSingle(bytes, i * 16 + 4);
                        d  = Math.Abs(System.BitConverter.ToSingle(bytes, i * 16 + 8));
                        t  = (int)System.BitConverter.ToSingle(bytes, i * 16 + 12);
                        // System.Console.WriteLine("ID" + id);
                        数据项哈希存储.AddData(ip, id, d, t);
                    }
                    if (this.解析完毕 != null)
                    {
                        this.解析完毕();
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void 发送数据请求()
        {
            DLL解析源.initSocket();
            string ip      = string.Empty;
            int    ipCount = _配置信息._ANYWAY.IPS.list.Count;

            for (int k = 0; k < ipCount; k++)
            {
                ip = _配置信息._ANYWAY.IPS.list[k].IP;

                DLL解析源.ConnetW(ip);
                DLL解析源.closeW();
                DLL解析源.ConnetW(ip);
                DLL解析源.WriteW(1, 1);
                int count = _配置信息._ANYWAY.list.Count;
                for (int i = 0; i < count; i++)
                {
                    if (_配置信息._ANYWAY.list[i].IP == ip)
                    {
                        DLL解析源.readW(_配置信息._ANYWAY.list[i].ADDRESS);
                    }
                }
                AnyWay类构造.获取功率分析仪(ip);
            }
        }