Example #1
0
        public void AddAnchor(string AnchorWsnId, double RSS)
        {
            this.AnchorWsnId = AnchorWsnId;
            Point      ANpos = new Point();
            AnchorNode TempNode;
            double     fRSS;

            ANpos = GetANPosition(AnchorWsnId);

            AnchorNode TempANode = Anchorlist.Find(AN => AN.nodeid == AnchorWsnId);
            int        index     = Anchorlist.IndexOf(TempANode);

            Anchorlist[index].RSS.Enqueue(RSS);

            if (Anchorlist[index].RSS.Count > 20)
            {
                do
                {
                    Anchorlist[index].RSS.Dequeue();
                } while (Anchorlist[index].RSS.Count > 20);
            }
            //RSS bestaande Anchor zoeken
            //bestaande Anchor Zoeken
            //TempNode = Anchorlist.Find(HasNodeID);
            //fRSS = RangeBasedPositioning.FilterRSS(TempNode.RSS);
            ////RSS filteren via RangeBasedPositioning.Filter
            //Anchorlist.RemoveAll(HasNodeID);
            //Anchorlist.Add(new AnchorNode(AnchorWsnId, ANpos.x, ANpos.y, fRSS));
        }
Example #2
0
 /// <summary>
 /// Delegate predicate for list.Exists
 /// </summary>
 /// <param name="AN"></param>
 /// <returns></returns>
 private bool HasNodeID(AnchorNode AN)
 {
     if (AN.nodeid == this.AnchorWsnId)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
 /// <summary>
 /// Delegate predicate for list.Exists
 /// </summary>
 /// <param name="AN"></param>
 /// <returns></returns>
 private bool HasNodeID(AnchorNode AN)
 {
     if (AN.nodeid == this.AnchorWsnId)
         return true;
     else
         return false;
 }