Ejemplo n.º 1
0
 public virtual void Update(MovableTarget target)
 {
     if (!string.IsNullOrEmpty(target.Name))
     {
         Name = target.Name;
     }
     MMSI           = target.MMSI;
     Lon            = target.Lon;
     Lat            = target.Lat;
     SOG            = target.SOG;
     COG            = target.COG;
     UpdateTime     = target.UpdateTime;
     OriginalObject = target.OriginalObject;
     removeTimeOutData();
     updateHistoryData(target.ShallowClone());
     if (_historyChanged)
     {
         fireUpdate();
     }
     else
     {
         fireUpdateLastData();
     }
     _historyChanged = false;
 }
Ejemplo n.º 2
0
 private void updateHistoryData(MovableTarget movableTarget)
 {
     if (History.Count == 0)
     {
         historyEnqueue(movableTarget);
     }
     else
     {
         var last = History.Last();
         if (Math.Abs(last.Lon - movableTarget.Lon) < 0.00001 && Math.Abs(last.Lat - movableTarget.Lat) < 0.00001)
         {
             last.UpdateTime = movableTarget.UpdateTime;
         }
         else if (last.UpdateTime == movableTarget.UpdateTime)
         {
             return;
         }
         else
         {
             historyEnqueue(movableTarget);
         }
     }
 }
Ejemplo n.º 3
0
 void historyEnqueue(MovableTarget movableTarget)
 {
     History.Enqueue(movableTarget);
     _historyChanged = true;
 }