예제 #1
0
        public async Task <int> 添加卫星根数(OrbitArgsInfo args)
        {
            if (string.IsNullOrEmpty(args.TleLine1) != string.IsNullOrEmpty(args.TleLine2))
            {
                throw new ArgumentException("双行根数不完整");
            }

            var info = new Satellite.OrbitArgsInfo
            {
                SatelliteName = args.SatelliteName,
                EpochTime     = args.EpochTime,
                TleLine1      = args.TleLine1,
                TleLine2      = args.TleLine2,
                轨道半长轴         = args.轨道半长轴,
                轨道偏心率         = args.轨道偏心率,
                轨道倾角          = args.轨道倾角,
                升交点赤经         = args.升交点赤经,
                近地点幅角         = args.近地点幅角,
                平近点角          = args.平近点角,
                大气阻尼系数        = args.大气阻尼系数,
                光压反射系数        = args.光压反射系数,
            };

            using (var db = new SqlSugarClient(ConnectionConfig))
                await db.Insertable(info).ExecuteCommandIdentityIntoEntityAsync();
            Service.Manage(info);
            return(info.ID);
        }
예제 #2
0
 public void Manage(OrbitArgsInfo orbitArgs)
 {
     if (SatelliteCaches.TryGetValue(orbitArgs.SatelliteName, out var sc))
     {
         if (sc.NewstOrbitArgs == null || sc.NewstOrbitArgs.EpochTime < orbitArgs.EpochTime)
         {
             sc.NewstOrbitArgs = orbitArgs;
         }
     }
     else
     {
         SatelliteCaches.Add(orbitArgs.SatelliteName, new SatelliteCache {
             NewstOrbitArgs = orbitArgs
         });
     }
 }