private void DrawLQILine(List <AssocList.DeviceAssocInfo_t> list)
        {
            int StartID = 0;
            int sx, sy, ex, ey;

            AssocList.DeviceAssocInfo_t d;
            while (StartID < list.Count)
            {
                AssocList.DeviceAssocInfo_t dev = list[StartID++];
                sx = dev.x;
                sy = dev.y;
                foreach (AssocList.NeighborInfo_t n in dev.Neighbor)
                {
                    if ((d = AssocList.GetDeviceAssocInfo(n.addr)) != null)
                    {
                        ex = d.x;
                        ey = d.y;
                        DrawLine(n.rxlqi, sx, sy, ex, ey);
                        DrawStringLqi(dev.addr, n.addr, n.rxlqi, dev.text_x, dev.text_y, ex, ey);
                        AssocList.SetTextPoint(n.addr, d.text_x, d.text_y + 25);

                        DrawStringLqi(dev.addr, n.addr, n.rxlqi, ShowLqiString_x, ShowLqiString_y, 0, 0);
                        ShowLqiString_y += 32;
                    }
                }
            }
        }
        private void DrawLayer(List <AssocList.DeviceAssocInfo_t> list, int x, int y, int w, int h)
        {
            float loss = 0;
            int   snd;
            byte  devType = 0;

            if (list != null)
            {
                while (DevStartID < list.Count)
                {
                    int devNum = DevNumPerLine;
                    int sw     = w / (devNum + 1);//分配宽度。
                    y = y + (DevHeight * DevHeightPerLine);
                    int sy = y;
                    for (int i = 0; (DevStartID < list.Count) && (i < devNum); i++)
                    {
                        int rsx = sw * (devNum / 2);//以当前设备的x轴为中心,计算左边起始位置。
                        if (x >= rsx)
                        {
                            rsx = x - rsx;
                        }
                        else
                        {
                            rsx = 0;
                        }
                        int sx = (rsx + (sw * i)) + sw / 2;//计算每个设备的x轴位置
                        AssocList.DeviceAssocInfo_t dev = list[DevStartID++];
                        devType = AssocList.GetDeviceType(dev.addr);
                        switch (devType)
                        {
                        case ZigbeeCommon.DevType_Route:
                            //DrawLine(dev.lqi,x,y,sx,sy);
                            loss = ZigbeeApi.Device.GetLossPercent(dev.addr);
                            snd  = ZigbeeApi.Device.GetSendCount(dev.addr);
                            DrawRouter(dev.addr, 0xFF, loss, snd, sx, sy);
                            dev.x      = sx;
                            dev.y      = sy;
                            dev.text_y = sy;
                            dev.text_x = sx;
                            //DrawLayer(list, sx, sy, sw, sh);
                            break;

                        case ZigbeeCommon.DevType_EndDev:
                            // DrawLine(dev.lqi, x, y, sx, sy);
                            loss = ZigbeeApi.Device.GetLossPercent(dev.addr);
                            snd  = ZigbeeApi.Device.GetSendCount(dev.addr);
                            DrawEndDevice(dev.addr, 0xFF, loss, snd, sx, sy);
                            dev.x      = sx;
                            dev.y      = sy;
                            dev.text_y = sy;
                            dev.text_x = sx;
                            break;

                        default:
                            // DrawLine(dev.lqi, x, y, sx, sy);
                            loss = ZigbeeApi.Device.GetLossPercent(dev.addr);
                            snd  = ZigbeeApi.Device.GetSendCount(dev.addr);
                            DrawOphanDevice(dev.addr, 0xFF, loss, snd, sx, sy);
                            dev.x      = sx;
                            dev.y      = sy;
                            dev.text_y = sy;
                            dev.text_x = sx;
                            break;
                        }
                    }
                }
                DrawLQILine(list);
            }
        }