public void AddGobject(int x1, int y1, int x2, int y2, MeshRelation prelation) { #region 为了防止刷新,不在此时画线!!! urinatedong 20170322 //Graphics g = this.panel2.CreateGraphics();//this.CreateGraphics(); //g.SmoothingMode = SmoothingMode.AntiAlias; //使绘图质量最高,即消除锯齿 //g.InterpolationMode = InterpolationMode.HighQualityBicubic; //g.CompositingQuality = CompositingQuality.HighQuality; //AdjustableArrowCap lineCap = new AdjustableArrowCap(5, 6, true); //Pen p; //if (prelation.Findtimes == 2) //{ // p = new Pen(Color.Blue,3); //} //else //{ // p = new Pen(Color.Orange,3); // p.DashStyle = DashStyle.Custom; // p.DashPattern = new float[] { 6, 3 }; //} //p.CustomEndCap = lineCap; //g.DrawLine(p, x1, y1, x2, y2); #endregion ///新需求中不再强调这些信息 ///urinatedong 20170314 //int xm = (x1 + x2) / 2; //int ym = (y1 + y2) / 2; string relationinfo = "Localport " + prelation.Localport + "\nTxsnr" + prelation.Txsnr + "\nTxspeed " + prelation.Txspeed + "\nRemoteport " + prelation.Remoteport + "\nRxsnr " + prelation.Rxsnr + "\nRxspeed " + prelation.Rxspeed + "\nFindTimes " + prelation.Findtimes; //AddText(xm, ym, relationinfo, false); //AddText(xm, ym, "Rx Tx", false); GObject TempGObject = new GObject(); //在数组中查找是否已经有该关系了 GNetwork.FindGObjectByName(prelation.Localnode.MacAddress + prelation.Remotenode.MacAddress, ref TempGObject); if (TempGObject.Type == "") { GNetwork.AddGObject(prelation.Localnode.MacAddress + prelation.Remotenode.MacAddress, "Line", x1, y1, x2, y2, relationinfo); } else { ///更新关系信息!!! TempGObject.AddInfo = relationinfo; } }