bool onTrack(GateTrackInfo track, bool isRemoved = false)
        {
            var gatetrack = track.GetGateTrack(isRemoved);

            if (isRemoved)
            {
                Common.Log.Logger.Default.Trace($"removed track:{track.GateId} {track.Gate.Name} {track.ShipID} {track.Ship.Ship.Name} - 状态: {track.TrackStatus} 报警时间: {track.Ship.OutstandTime} 已报警? {track.Ship.IsOutstanded} - 找到报文: {gatetrack?.ToJson()}");
            }
            if (gatetrack != null)
            {
                if ((isRemoved && gatetrack.msgType == "4") || (!isRemoved && gatetrack.msgType != "4"))
                {
                    string strJson = gatetrack.ToJson();
                    _listener?.Send(strJson);

                    Common.Log.Logger.Default.Trace("send: track " + strJson);
                    Console.WriteLine($"正在跟踪 - {strJson}");
                    if (gatetrack.msgType == "1" || gatetrack.msgType == "2")//完成进出港报警
                    {
                        track.Ship.IsOutstanded = true;
                    }
                    track.Ship.NotifyTime = track.Ship.Ship.UpdateTime;
                    System.Threading.Thread.Sleep(50);
                    return(true);
                }
            }
            return(false);
        }
 bool onTrack(GateTrackInfo track)
 {
     if (IsInner)
     {
         track.TrackStatus = GateTrackStatus.InnerTrack;
     }
     else
     {
         track.TrackStatus = GateTrackStatus.OuterTrack;
     }
     return(FenceTrackMgr.Instance.UpdateTrack(track));
 }
 bool updateReplaceGateUtil(GateTrackInfo lastTrack, ShipTrackConfig shipInfo, string gateId)
 {
     if (lastTrack == null)
     {
         var gateInfo = FenceMgr.Instance.Fence.Gates.FirstOrDefault(_ => _.ID == gateId);
         lastTrack = new GateTrackInfo(gateInfo, shipInfo);
     }
     else
     {
         lastTrack.Update(shipInfo);
     }
     return(onTrack(lastTrack));
 }
        public bool UpdateTrack(GateTrackInfo track)
        {
            var last = _tracks.FirstOrDefault(t => t.GateId == track.GateId);

            if (last != null)
            {
                last.Update(track.Ship);
                last.TrackStatus = track.TrackStatus;
                //last = track;
            }
            else
            {
                _tracks.Add(track);
            }
            return(onTrack(track));
        }