Beispiel #1
0
 private void updateDicCacheAISTele5(WXAISTele5 obj)
 {
     if (_dicCacheAISTele5.ContainsKey(obj.Id))
     {
         _dicCacheAISTele5[obj.Id] = obj;
     }
     else
     {
         _dicCacheAISTele5.Add(obj.Id, obj);
     }
 }
Beispiel #2
0
        public void HandleMsg(Msg[] msgs)
        {
            foreach (Msg msg in msgs)
            {
                //此处暂时将所有文本中的逗号改成了空格,是为了可以用逗号作为分隔符的ASCII方式表示数据
                if (msg is Tele123)
                {
                    Tele123      tel = msg as Tele123;
                    WXAISTele123 at  = new WXAISTele123();
                    //at.Id = tel.MMSI.ToString();
                    //at.MMSI = tel.MMSI;
                    //at.Src = getSrcName();
                    //at.Time = tel.DataTime;
                    //at.Shape = new GeoPointShape(tel.Longitude, tel.Latitude);
                    //at.SOG = tel.SOG;
                    //at.COG = tel.COG;
                    //at.Heading = tel.TrueHeading;
                    //at.NavStatus = tel.NavStatus;
                    //at.CommStateValue = 0;
                    //at.PositionAccuracy = tel.PositionAccuracy;
                    //at.RAIM_Flag = tel.RAIM_Flag;
                    //at.ROT_AIS = tel.ROT_AIS;
                    //at.TimeStamp = tel.TimeStamp;
                    //at.UTCTime = tel.CommState.UTCTime;
                    WXAISTarget target = new WXAISTarget(tel.MMSI);

                    target.Src              = getSrcName();
                    target.Lon              = tel.Longitude;
                    target.Lat              = tel.Latitude;
                    target.SOG              = tel.SOG;
                    target.COG              = tel.COG;
                    target.Heading          = tel.TrueHeading;
                    target.NavStatus        = tel.NavStatus;
                    target.PositionAccuracy = tel.PositionAccuracy;
                    target.RAIM_Flag        = tel.RAIM_Flag;
                    target.UpdateTime       = tel.DataTime;
                    target.TimeStamp        = tel.TimeStamp;
                    target.Name             = GetNameFromFicCacheAISTele5(target.GetId());

                    fireOnDynamic(target);
                }
                else if (msg is Tele5)
                {
                    Tele5      tel = msg as Tele5;
                    WXAISTele5 at  = new WXAISTele5();
                    at.Id            = tel.MMSI.ToString();
                    at.Src           = getSrcName();
                    at.Time          = tel.DataTime;
                    at.Name          = trim(tel.Name);
                    at.ShipCargoType = tel.ShipCargoType;
                    at.AIS_Version   = tel.AIS_Version;
                    at.CallSign      = trim(tel.CallSign);
                    at.Destination   = trim(tel.Destination);
                    at.DTE           = tel.DTE;
                    at.EPFD_Type     = tel.EPFD_Type;
                    at.ETA           = tel.ETA;
                    at.IMO_Number    = tel.IMO_Number;
                    at.MaxSeaGauge   = tel.Draught;
                    at.Measure_A     = tel.Measure_A;
                    at.Measure_B     = tel.Measure_B;
                    at.Measure_C     = tel.Measure_C;
                    at.Measure_D     = tel.Measure_D;

                    updateDicCacheAISTele5(at);
                }
                else if (msg is Tele18)
                {
                    Tele18 tel = msg as Tele18;
                    //WXAISTele18 at = new WXAISTele18();
                    //at.Id = tel.MMSI.ToString();
                    //at.MMSI = tel.MMSI;
                    //at.Src = getSrcName();
                    //at.Time = tel.DataTime;
                    //at.Shape = new GeoPointShape(tel.Longitude, tel.Latitude);
                    //at.SOG = tel.SOG;
                    //at.COG = tel.COG;
                    //at.Heading = tel.TrueHeading;
                    //at.CommState = 0;
                    //at.PositionAccuracy = tel.PositionAccuracy;
                    //at.RAIM_Flag = tel.RAIM_Flag;
                    //at.TimeStamp = tel.TimeStamp;


                    //WXAISTele19 sat = DynamicObjContainerHelper.GetObject("WXAISTELE19", at.Id) as WXAISTele19;
                    //if (sat != null)
                    //    at.Name = sat.Name;

                    WXAISTarget target = new WXAISTarget(tel.MMSI);

                    target.Src              = getSrcName();
                    target.Lon              = tel.Longitude;
                    target.Lat              = tel.Latitude;
                    target.SOG              = tel.SOG;
                    target.COG              = tel.COG;
                    target.Heading          = tel.TrueHeading;
                    target.NavStatus        = 0;
                    target.PositionAccuracy = tel.PositionAccuracy;
                    target.RAIM_Flag        = tel.RAIM_Flag;
                    target.UpdateTime       = tel.DataTime;
                    target.TimeStamp        = tel.TimeStamp;
                    target.Name             = GetNameFromFicCacheAISTele19(target.GetId());

                    fireOnDynamic(target);
                }
                else if (msg is Tele19)
                {
                    Tele19      tel = msg as Tele19;
                    WXAISTele19 at  = new WXAISTele19();
                    at.Id               = tel.MMSI.ToString();
                    at.Src              = getSrcName();
                    at.Time             = tel.DataTime;
                    at.Name             = trim(tel.Name);
                    at.ShipCargoType    = tel.ShipCargoType;
                    at.COG              = tel.COG;
                    at.DTE              = tel.DTE;
                    at.EPFD_Type        = tel.EPFD_Type;
                    at.Latitude         = tel.Latitude;
                    at.Longitude        = tel.Longitude;
                    at.Measure_A        = tel.Measure_A;
                    at.Measure_B        = tel.Measure_B;
                    at.Measure_C        = tel.Measure_C;
                    at.Measure_D        = tel.Measure_D;
                    at.PositionAccuracy = tel.PositionAccuracy;
                    at.RAIM_Flag        = tel.RAIM_Flag;
                    at.SOG              = tel.SOG;
                    at.TimeStamp        = tel.TimeStamp;
                    at.TrueHeading      = tel.TrueHeading;

                    updateDicCacheAISTele19(at);
                }
                else if (msg is Tele21)
                {
                    Tele21      tel = msg as Tele21;
                    WXAISTele21 at  = new WXAISTele21();
                    at.Id               = tel.MMSI.ToString();
                    at.Src              = getSrcName();
                    at.Time             = tel.DataTime;
                    at.Shape            = new GeoPointShape(tel.Longitude, tel.Latitude);
                    at.Name             = trim(tel.Name);
                    at.AtoNType         = tel.Type;
                    at.EPFD_Type        = tel.EPFD_Type;
                    at.Measure_A        = tel.Measure_A;
                    at.Measure_B        = tel.Measure_B;
                    at.Measure_C        = tel.Measure_C;
                    at.Measure_D        = tel.Measure_D;
                    at.OffPosition      = tel.OffPosition;
                    at.PositionAccuracy = tel.PositionAccuracy;
                    at.RAIM_Flag        = tel.RAIM_Flag;
                    at.TimeStamp        = tel.TimeStamp;

                    WXAISTarget target = new WXAISTarget(tel.MMSI);

                    target.Name             = trim(tel.Name);
                    target.Src              = getSrcName();
                    target.Lon              = tel.Longitude;
                    target.Lat              = tel.Latitude;
                    target.AtoNType         = tel.Type;
                    target.NavStatus        = 0;
                    target.PositionAccuracy = tel.PositionAccuracy;
                    target.RAIM_Flag        = tel.RAIM_Flag;
                    target.UpdateTime       = tel.DataTime;
                    target.TimeStamp        = tel.TimeStamp;

                    fireOnDynamic(target);
                }
                else if (msg is Tele4)
                {
                    Tele4      tel = msg as Tele4;
                    WXAISTele4 at  = new WXAISTele4();
                    at.Id    = tel.MMSI.ToString();
                    at.Src   = getSrcName();
                    at.Time  = tel.DataTime;
                    at.Shape = new GeoPointShape(tel.Longitude, tel.Latitude);
                    at.Name  = tel.MMSI.ToString();
                    at.UTC   = tel.UTC;

                    WXAISTarget target = new WXAISTarget(tel.MMSI);

                    target.Name       = tel.MMSI.ToString();
                    target.Src        = getSrcName();
                    target.Lon        = tel.Longitude;
                    target.Lat        = tel.Latitude;
                    target.UpdateTime = tel.DataTime;
                    fireOnDynamic(target);
                }
            }
        }