using System; using System.Collections.Generic; using System.Data.Entity; using System.Data.SqlClient; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.Http; using Serilog; using XdCxRhDw.Dto; using XdCxRhDW.App.Api; using XdCxRhDW.Core.Api; using XdCxRhDW.Dto; namespace XdCxRhDW.WebApi.Controllers { /// /// 星历推算功能相关接口 /// public class XlController : BaseController { /// /// 推算某个时间点星历 /// /// 双行根 /// 推算时刻(北京时刻) /// [HttpGet] public async Task> Calc(string tleStr, DateTime dt) { var p = EphHelper.Calc(tleStr, dt); return Success(new SatEphDto() { SatId = p.SatId, SatTime = p.SatTime, TleTime = p.TleTime, X = p.X, Y = p.Y, Z = p.Z, VX = p.VX, VY = p.VY, VZ = p.VZ, }); } /// /// 推算某个时间段星星历 /// /// 双行根 /// 开始时刻(北京时刻) /// 结束时刻(北京时刻) /// 推算间隔(秒) /// [HttpGet] public async Task>> CalcMult(string tleStr, DateTime start, DateTime end, int spanSeconds) { var eph = EphHelper.CalcMult(tleStr, start, end, spanSeconds); return Success(eph.Select(p => new EphResDto() { SatId = p.SatId, SatTime = p.SatTime, TleTime = p.TleTime, X = p.X, Y = p.Y, Z = p.Z, VX = p.VX, VY = p.VY, VZ = p.VZ, }).ToList()); } } }