using SimulationCommon; namespace Model { public class FXJHGenerate { public static TurningPoint[] FromStartToMission(FlightPlanEditor editor, TurningPoint[] turningPoints) //生成从基地到任务段起点的航路点 { turningPoints[0].TurningPointName = "爬升"; turningPoints[0].TurningPointLongitude = editor.originbase.BaseLongitude; //基地位置 turningPoints[0].TurningPointLatitude = editor.originbase.BaseLatitude; turningPoints[0].TurningPointHeight = editor.originbase.BaseHeight; turningPoints[0].TurningPointType = "普通"; //turningPoints[0].TurningPointVelocity = editor.climbsegment.ClimbVelocity; turningPoints[0].SegmentFlightFuelConsumption = 1; turningPoints[0].SegmentFlightTime = 0; turningPoints[0].RemainingFuel = 0; double k; double lat1, lon1; //直升机起飞后爬升到的航路点的经纬度,记为经纬度1 k = (editor.missionpoint.MissionPointLatitude - editor.originbase.BaseLatitude) / (editor.missionpoint.MissionPointLongitude - editor.originbase.BaseLongitude); if (editor.missionpoint.MissionPointLongitude > editor.originbase.BaseLongitude) { lat1 = 0.08544 * k / (Math.Sqrt(k * k + 1)) + editor.originbase.BaseLatitude; //经验公式 lon1 = 0.08544 / (Math.Sqrt(k * k + 1)) + editor.originbase.BaseLongitude; } else { lat1 = editor.originbase.BaseLatitude - 0.08544 * k / (Math.Sqrt(k * k + 1)); lon1 = editor.originbase.BaseLongitude - 0.08544 / (Math.Sqrt(k * k + 1)); } turningPoints[1].TurningPointName = "巡航"; turningPoints[1].TurningPointLongitude = lon1; turningPoints[1].TurningPointLatitude = lat1; turningPoints[1].TurningPointHeight = 2000; turningPoints[1].TurningPointType = "普通"; turningPoints[1].SegmentFlightFuelConsumption = 2; turningPoints[1].SegmentFlightTime = 0; turningPoints[1].RemainingFuel = 0; return turningPoints; } //获取油耗率 public static double GetClimbFuelConsumptionRate(FlightPlanEditor editor, double height) { double temp = Util.GetTemperature(editor.originbase.BaseLongitude, editor.originbase.BaseLatitude); Fuel fuel = Util.GetFuel(editor.aircraftparameter.AircraftID, editor.aircraftparameter.AircraftSubType, "爬升", temp.ToString(), height.ToString(), editor.aircraftparameter.MaxTakeoffWeight.ToString()); if (fuel == null) { return 1100; } return fuel.oilconsume; } public static double GetCruisingFuelConsumptionRate(FlightPlanEditor editor, double height) { double temp = Util.GetTemperature(editor.originbase.BaseLongitude, editor.originbase.BaseLatitude); Fuel fuel = Util.GetFuel(editor.aircraftparameter.AircraftID, editor.aircraftparameter.AircraftSubType, "平飞远航", temp.ToString(), height.ToString(), editor.aircraftparameter.MaxTakeoffWeight.ToString()); if (fuel == null) { return 600; } return fuel.oilconsume; } public static double GetEnduranceFuelConsumptionRate(FlightPlanEditor editor, double height) { double temp = Util.GetTemperature(editor.originbase.BaseLongitude, editor.originbase.BaseLatitude); Fuel fuel = Util.GetFuel(editor.aircraftparameter.AircraftID, editor.aircraftparameter.AircraftSubType, "平飞久航", temp.ToString(), height.ToString(), editor.aircraftparameter.MaxTakeoffWeight.ToString()); if (fuel == null) { return 600; } return fuel.oilconsume; } public static double GetDescentFuelConsumptionRate(FlightPlanEditor editor, double height) { return 2 * GetCruisingFuelConsumptionRate(editor, height) - GetClimbFuelConsumptionRate(editor, height); } public static double GetHoverFuelConsumptionRate(FlightPlanEditor editor, double height) { double temp = Util.GetTemperature(editor.originbase.BaseLongitude, editor.originbase.BaseLatitude); Fuel fuel = Util.GetFuel(editor.aircraftparameter.AircraftID, editor.aircraftparameter.AircraftSubType, "悬停", temp.ToString(), height.ToString(), editor.aircraftparameter.MaxTakeoffWeight.ToString()); if (fuel == null) { return 200; } return fuel.oilconsume; } //获取速度值 public static double GetClimbVelocity(FlightPlanEditor editor, double height) { double temp = Util.GetTemperature(editor.originbase.BaseLongitude, editor.originbase.BaseLatitude); Fuel fuel = Util.GetFuel(editor.aircraftparameter.AircraftID, editor.aircraftparameter.AircraftSubType, "爬升", temp.ToString(), height.ToString(), editor.aircraftparameter.MaxTakeoffWeight.ToString()); if (fuel == null) { return 60; } return fuel.speed; } public static double GetCruisingVelocity(FlightPlanEditor editor, double height) { double temp = Util.GetTemperature(editor.originbase.BaseLongitude, editor.originbase.BaseLatitude); Fuel fuel = Util.GetFuel(editor.aircraftparameter.AircraftID, editor.aircraftparameter.AircraftSubType, "平飞远航", temp.ToString(), height.ToString(), editor.aircraftparameter.MaxTakeoffWeight.ToString()); if (fuel == null) { return 200; } return fuel.speed; } public static double GetEnduranceVelocity(FlightPlanEditor editor, double height) { double temp = Util.GetTemperature(editor.originbase.BaseLongitude, editor.originbase.BaseLatitude); Fuel fuel = Util.GetFuel(editor.aircraftparameter.AircraftID, editor.aircraftparameter.AircraftSubType, "平飞久航", temp.ToString(), height.ToString(), editor.aircraftparameter.MaxTakeoffWeight.ToString()); if (fuel == null) { return 200; } return fuel.speed; } public static double GetDescentVelocity(FlightPlanEditor editor, double height) { return GetCruisingVelocity(editor, height) / 2; } public static TurningPoint[] ZhenCha(List SC01, FlightPlanEditor editor, TurningPoint[] turningPoints) //侦查模型航路点生成 { int i; for (i = 0; i < SC01.Count - 1; i++) { turningPoints[i + 2].TurningPointName = "巡航"; turningPoints[i + 2].TurningPointLongitude = SC01[i][0]; turningPoints[i + 2].TurningPointLatitude = SC01[i][1]; turningPoints[i + 2].TurningPointHeight = SC01[i][2]; turningPoints[i + 2].TurningPointType = "侦查"; turningPoints[i + 2].SegmentFlightFuelConsumption = 3; turningPoints[i + 2].SegmentFlightTime = 0; turningPoints[i + 2].RemainingFuel = 0; } return turningPoints; } public static TurningPoint[] SuoHuaJiang(double resulttime, FlightPlanEditor editor, TurningPoint[] turningPoints) //索滑降模型航路点生成 { turningPoints[2].TurningPointName = "索滑降"; turningPoints[2].TurningPointLongitude = editor.missionpoint.MissionPointLongitude; turningPoints[2].TurningPointLatitude = editor.missionpoint.MissionPointLatitude; turningPoints[2].TurningPointHeight = editor.missionpoint.MissionPointHeight; turningPoints[2].TurningPointType = "索滑降"; turningPoints[2].SegmentFlightFuelConsumption = 5; turningPoints[2].SegmentFlightTime = resulttime; turningPoints[2].RemainingFuel = 0; return turningPoints; } public static TurningPoint[] XunHu(FlightPlanEditor editor, TurningPoint[] turningPoints) { int i; for (i = 0; i < editor.airroute.Length; i++) { turningPoints[2 + i].TurningPointName = "巡航"; turningPoints[2 + i].TurningPointLongitude = editor.airroute[i].AirRouteLongitude; turningPoints[2 + i].TurningPointLatitude = editor.airroute[i].AirRouteLatitude; turningPoints[2 + i].TurningPointHeight = editor.airroute[i].AirRouteHeight; turningPoints[2 + i].TurningPointType = "普通"; turningPoints[2 + i].SegmentFlightFuelConsumption = 3; turningPoints[2 + i].SegmentFlightTime = 0; turningPoints[2 + i].RemainingFuel = 0; } return turningPoints; } public static TurningPoint[] MieHuo1(FlightPlanEditor editor, TurningPoint[] turningPoints, int PointNumberIcon) //灭火任务从取水点到火场部分的航路点生成 { turningPoints[2 + PointNumberIcon].TurningPointName = "取水"; //PointNumberIcon:洒水的次数 turningPoints[2 + PointNumberIcon].TurningPointLongitude = editor.missionpoint.MissionPointLongitude; turningPoints[2 + PointNumberIcon].TurningPointLatitude = editor.missionpoint.MissionPointLatitude; turningPoints[2 + PointNumberIcon].TurningPointHeight = editor.missionpoint.MissionPointHeight; turningPoints[2 + PointNumberIcon].TurningPointType = "取水"; turningPoints[2 + PointNumberIcon].SegmentFlightFuelConsumption = 3; turningPoints[2 + PointNumberIcon].SegmentFlightTime = 120; turningPoints[2 + PointNumberIcon].RemainingFuel = 0; //从火点飞到灭火模型返回的精确地洒水点 turningPoints[3 + PointNumberIcon].TurningPointName = "洒水"; turningPoints[3 + PointNumberIcon].TurningPointLongitude = editor.firepoint[0].FirePointLongitude; turningPoints[3 + PointNumberIcon].TurningPointLatitude = editor.firepoint[0].FirePointLatitude; turningPoints[3 + PointNumberIcon].TurningPointHeight = editor.firepoint[0].FirePointHeight; turningPoints[3 + PointNumberIcon].TurningPointType = "巡航"; turningPoints[3 + PointNumberIcon].SegmentFlightFuelConsumption = 3; turningPoints[3 + PointNumberIcon].SegmentFlightTime = 0; turningPoints[3 + PointNumberIcon].RemainingFuel = 0; return turningPoints; } public static MissionEndPoint ZhenChaMissionEndPoint(List SC01) //侦查模型任务终点生成 { MissionEndPoint missionEndPoint = new(); int length = SC01.Count - 1; missionEndPoint.MissionEndPointLongitude = SC01[length][0]; missionEndPoint.MissionEndPointLatitude = SC01[length][1]; missionEndPoint.MissionEndPointHeight = SC01[length][2]; return missionEndPoint; } public static MissionEndPoint SuoHuaJiangMissionEndPoint(FlightPlanEditor editor) //索滑降模型任务终点生成 { MissionEndPoint missionEndPoint = new(); missionEndPoint.MissionEndPointLongitude = editor.missionpoint.MissionPointLongitude; missionEndPoint.MissionEndPointLatitude = editor.missionpoint.MissionPointLatitude; missionEndPoint.MissionEndPointHeight = editor.missionpoint.MissionPointHeight; return missionEndPoint; } public static TurningPoint[] JijiangMiehuo(FlightPlanEditor editor, TurningPoint[] turningPoints, int TransportNumber) { turningPoints[2 + TransportNumber].TurningPointName = "地面灭火"; // turningPoints[2 + TransportNumber].TurningPointLongitude = editor.originbase.BaseLongitude; turningPoints[2 + TransportNumber].TurningPointLatitude = editor.originbase.BaseLatitude; turningPoints[2 + TransportNumber].TurningPointHeight = editor.originbase.BaseHeight; turningPoints[2 + TransportNumber].TurningPointType = "转运"; turningPoints[2 + TransportNumber].SegmentFlightFuelConsumption = 2; turningPoints[2 + TransportNumber].SegmentFlightTime = 0; turningPoints[2 + TransportNumber].RemainingFuel = 0; turningPoints[3 + TransportNumber].TurningPointName = "地面灭火"; turningPoints[3 + TransportNumber].TurningPointLongitude = editor.missionpoint.MissionPointLongitude; turningPoints[3 + TransportNumber].TurningPointLatitude = editor.missionpoint.MissionPointLatitude; turningPoints[3 + TransportNumber].TurningPointHeight = editor.missionpoint.MissionPointHeight; turningPoints[3 + TransportNumber].TurningPointType = "转运"; turningPoints[3 + TransportNumber].SegmentFlightFuelConsumption = 2; turningPoints[3 + TransportNumber].SegmentFlightTime = 0; turningPoints[3 + TransportNumber].RemainingFuel = 0; return turningPoints; } public static TurningPoint[] FromMissionToEnd(FlightPlanEditor editor, MissionEndPoint missionEndPoint, TurningPoint[] turningPoints, int Length) //生成从任务段终点到基地的航路点 { turningPoints[Length].TurningPointName = "巡航"; turningPoints[Length].TurningPointLongitude = missionEndPoint.MissionEndPointLongitude; turningPoints[Length].TurningPointLatitude = missionEndPoint.MissionEndPointLatitude; turningPoints[Length].TurningPointHeight = missionEndPoint.MissionEndPointHeight; turningPoints[Length].TurningPointType = "普通"; turningPoints[Length].SegmentFlightFuelConsumption = 3; turningPoints[Length].SegmentFlightTime = 0; turningPoints[Length].RemainingFuel = 0; double k; double lat2, lon2; k = (turningPoints[Length].TurningPointLatitude - editor.originbase.BaseLatitude) / (turningPoints[Length].TurningPointLongitude - editor.originbase.BaseLongitude); if (turningPoints[Length].TurningPointLongitude > editor.originbase.BaseLongitude) { lat2 = 0.08544 * k / (Math.Sqrt(k * k + 1)) + editor.originbase.BaseLatitude; lon2 = 0.08544 / (Math.Sqrt(k * k + 1)) + editor.originbase.BaseLongitude; } else { lat2 = editor.originbase.BaseLatitude - 0.08544 * k / (Math.Sqrt(k * k + 1)); lon2 = editor.originbase.BaseLongitude - 0.08544 / (Math.Sqrt(k * k + 1)); } turningPoints[Length + 1].TurningPointName = "降高"; turningPoints[Length + 1].TurningPointLongitude = lon2; turningPoints[Length + 1].TurningPointLatitude = lat2; turningPoints[Length + 1].TurningPointHeight = 2000; turningPoints[Length + 1].TurningPointType = "普通"; turningPoints[Length + 1].SegmentFlightFuelConsumption = 4; turningPoints[Length + 1].SegmentFlightTime = 0; turningPoints[Length + 1].RemainingFuel = 0; return turningPoints; } public static void InitializeVelocities(FlightPlanEditor editor, TurningPoint[] turningPoints, ref double[] velocitys) { velocitys[0] = GetClimbVelocity(editor, turningPoints[0].TurningPointHeight); velocitys[1] = GetCruisingVelocity(editor, turningPoints[1].TurningPointHeight); velocitys[2] = GetEnduranceVelocity(editor, turningPoints[2].TurningPointHeight); velocitys[3] = GetDescentVelocity(editor, turningPoints[0].TurningPointHeight); } public static void InitializeFuelConsumptions(FlightPlanEditor editor, TurningPoint[] turningPoints, ref double[] fuelConsumptions) { fuelConsumptions[0] = GetClimbFuelConsumptionRate(editor, turningPoints[0].TurningPointHeight); fuelConsumptions[1] = GetCruisingFuelConsumptionRate(editor, turningPoints[1].TurningPointHeight); fuelConsumptions[2] = GetEnduranceFuelConsumptionRate(editor, turningPoints[2].TurningPointHeight); fuelConsumptions[3] = GetDescentFuelConsumptionRate(editor, turningPoints[0].TurningPointHeight); fuelConsumptions[4] = GetHoverFuelConsumptionRate(editor, turningPoints[2].TurningPointHeight); } public static TurningPoint[] FXJHTPDiedai(FlightPlanEditor editor, TurningPoint[] turningPoints, int FXJHTPLength, double[] velocitys, double[] fuelConsumptions) //各航段飞行时间、油耗计算和航路点油耗迭代 { TurningPoint[] FXJHTP = turningPoints; int i; double DEG_TO_RAD_LOCAL = 3.1415926535897932 / 180; double[] x = new double[FXJHTPLength]; double[] y = new double[FXJHTPLength]; double[] z = new double[FXJHTPLength]; for (i = 0; i < FXJHTPLength; i++) //LLA坐标转换为ECEF坐标 { double lon = FXJHTP[i].TurningPointLongitude * DEG_TO_RAD_LOCAL; double lat = FXJHTP[i].TurningPointLatitude * DEG_TO_RAD_LOCAL; double hei = FXJHTP[i].TurningPointHeight; double a = 6378137.0; double b = 6356752.31424518; double N = a / (Math.Sqrt(1 - ((a * a - b * b) / (a * a)) * Math.Sin(lat) * Math.Sin(lat))); x[i] = (N + hei) * Math.Cos(lat) * Math.Cos(lon); y[i] = (N + hei) * Math.Cos(lat) * Math.Sin(lon); z[i] = ((b * b * N) / (a * a) + hei) * Math.Sin(lat); } for (i = 0; i < FXJHTPLength; i++) { if (FXJHTP[i].SegmentFlightTime == 0) { double distanceab; if (i != FXJHTPLength - 1) { distanceab = Math.Sqrt(Math.Pow(x[i] - x[i + 1], 2) + Math.Pow(y[i] - y[i + 1], 2) + Math.Pow(z[i] - z[i + 1], 2)); } else { distanceab = Math.Sqrt(Math.Pow(x[i] - x[0], 2) + Math.Pow(y[i] - y[0], 2) + Math.Pow(z[i] - z[0], 2)); } double velocity; // 根据飞行段类型选择不同的燃油消耗率计算函数 switch (FXJHTP[i].SegmentFlightFuelConsumption) { case 1: velocity = velocitys[0]; break; case 2: velocity = velocitys[1]; break; case 3: velocity = velocitys[2]; break; case 4: velocity = velocitys[3]; break; case 5: velocity = 0; break; default: velocity = 0; break; } // 使用计算得到的速度计算飞行时间 FXJHTP[i].SegmentFlightTime = CalculateSegmentFlightTime(distanceab, velocity); double CalculateSegmentFlightTime(double distance, double velocity) { return distance * 3.6 / velocity; // 根据速度计算飞行时间 } } else { FXJHTP[i].SegmentFlightTime = FXJHTP[i].SegmentFlightTime; } } for (i = 0; i < FXJHTPLength; i++) { double remainingFuel; if (i == 0) { remainingFuel = editor.aircraftparameter.MaxFuelCapacity * 0.8; } else { remainingFuel = FXJHTP[i - 1].RemainingFuel; } double fuelConsumption = 0; // 根据飞行段类型选择不同的燃油消耗率计算函数,1代表爬升,2代表平飞远航,3代表平飞久航,4代表下降,5代表悬停 switch (FXJHTP[i].SegmentFlightFuelConsumption) { case 1: fuelConsumption = fuelConsumptions[0]; break; case 2: fuelConsumption = fuelConsumptions[1]; break; case 3: fuelConsumption = fuelConsumptions[2]; break; case 4: fuelConsumption = fuelConsumptions[3]; break; case 5: fuelConsumption = fuelConsumptions[4]; break; } remainingFuel -= fuelConsumption * FXJHTP[i].SegmentFlightTime / 3600; // 更新剩余燃油 if (remainingFuel < 0) { remainingFuel = 0; break; } FXJHTP[i].RemainingFuel = remainingFuel; } return FXJHTP; } public static void FXJHTPPrint(TurningPoint[] FXJHTP, int FXJHTPLength) //航路点打印 { int i; for (i = 0; i < FXJHTPLength; i++) { Console.WriteLine("航路点序号: {0}", i + 1); // {0}是占位符,在字符串中插入变量的值 Console.WriteLine("航路点名称: {0}", FXJHTP[i].TurningPointName); Console.WriteLine("航路点类型: {0}", FXJHTP[i].TurningPointType); Console.WriteLine("航路点时间: {0}", FXJHTP[i].SegmentFlightTime); Console.WriteLine("航路点油耗: {0}", FXJHTP[i].SegmentFlightFuelConsumption); Console.WriteLine("航路点经度: {0}", FXJHTP[i].TurningPointLongitude); Console.WriteLine("航路点纬度: {0}", FXJHTP[i].TurningPointLatitude); Console.WriteLine("航路点海拔: {0}", FXJHTP[i].TurningPointHeight); } } /// /// 巡护用 /// /// /// /// /// public static CurrentLocation GetCurrentLocation(TurningPoint[] turningPoints, FlightPlanEditor editor, double nowtime) { CurrentLocation currentLocation = new CurrentLocation(); double[] timetable = new double[editor.airroute.Length + 2]; //airroute.Length表示巡护航线中有几个航路点 timetable[0] = 0; //设起飞时刻为0 int segmentnumber = -1; int i; for (i = 0; i < editor.airroute.Length + 1; i++) { timetable[i + 1] = timetable[i] + turningPoints[i].SegmentFlightTime; } for (i = 0; i < editor.airroute.Length + 2; i++) { if ((nowtime - timetable[i]) >= 0) { segmentnumber += 1; } else { break; } } currentLocation.CurrentLon = turningPoints[segmentnumber].TurningPointLongitude + (turningPoints[segmentnumber + 1].TurningPointLongitude - turningPoints[segmentnumber].TurningPointLongitude) * (nowtime - timetable[segmentnumber]) / turningPoints[segmentnumber].SegmentFlightTime; currentLocation.CurrentLat = turningPoints[segmentnumber].TurningPointLatitude + (turningPoints[segmentnumber + 1].TurningPointLatitude - turningPoints[segmentnumber].TurningPointLatitude) * (nowtime - timetable[segmentnumber]) / turningPoints[segmentnumber].SegmentFlightTime; currentLocation.CurrentHei = turningPoints[segmentnumber].TurningPointHeight + (turningPoints[segmentnumber + 1].TurningPointHeight - turningPoints[segmentnumber].TurningPointHeight) * (nowtime - timetable[segmentnumber]) / turningPoints[segmentnumber].SegmentFlightTime; currentLocation.CurrentFuel = 0; currentLocation.Currentvelo = 0; currentLocation.Currentsegnum = segmentnumber + 1; currentLocation.CurrentCourse = 75; return currentLocation; } //改 /// /// 计算当前位置 /// /// /// /// /// public static CurrentLocation GetAllCurrentLocation(TurningPoint[] FXJHTP, int FXJHTPLength, double nowtime) //飞机实时位置打印 { CurrentLocation currentLocation = new CurrentLocation(); double[] timetable = new double[FXJHTPLength + 1]; timetable[0] = 0; int segmentnumber = -1; int i; for (i = 0; i < FXJHTPLength; i++) { timetable[i + 1] = timetable[i] + FXJHTP[i].SegmentFlightTime; } for (i = 0; i < FXJHTPLength + 1; i++) { if ((nowtime - timetable[i]) >= 0) { segmentnumber += 1; } else { break; } } if (segmentnumber < FXJHTPLength - 1) { currentLocation.CurrentLon = FXJHTP[segmentnumber].TurningPointLongitude + ((FXJHTP[segmentnumber + 1].TurningPointLongitude - FXJHTP[segmentnumber].TurningPointLongitude) / FXJHTP[segmentnumber].SegmentFlightTime) * (nowtime - timetable[segmentnumber]); currentLocation.CurrentLat = FXJHTP[segmentnumber].TurningPointLatitude + ((FXJHTP[segmentnumber + 1].TurningPointLatitude - FXJHTP[segmentnumber].TurningPointLatitude) / FXJHTP[segmentnumber].SegmentFlightTime) * (nowtime - timetable[segmentnumber]); currentLocation.CurrentHei = FXJHTP[segmentnumber].TurningPointHeight + ((FXJHTP[segmentnumber + 1].TurningPointHeight - FXJHTP[segmentnumber].TurningPointHeight) / FXJHTP[segmentnumber].SegmentFlightTime) * (nowtime - timetable[segmentnumber]); currentLocation.CurrentFuel = FXJHTP[segmentnumber].RemainingFuel - FXJHTP[segmentnumber].SegmentFlightFuelConsumption * (nowtime - timetable[segmentnumber]); } else if (segmentnumber == FXJHTPLength - 1) { currentLocation.CurrentLon = FXJHTP[segmentnumber].TurningPointLongitude + ((FXJHTP[0].TurningPointLongitude - FXJHTP[segmentnumber].TurningPointLongitude) / FXJHTP[segmentnumber].SegmentFlightTime) * (nowtime - timetable[segmentnumber]); currentLocation.CurrentLat = FXJHTP[segmentnumber].TurningPointLatitude + ((FXJHTP[0].TurningPointLatitude - FXJHTP[segmentnumber].TurningPointLatitude) / FXJHTP[segmentnumber].SegmentFlightTime) * (nowtime - timetable[segmentnumber]); currentLocation.CurrentHei = FXJHTP[segmentnumber].TurningPointHeight + ((FXJHTP[0].TurningPointHeight - FXJHTP[segmentnumber].TurningPointHeight) / FXJHTP[segmentnumber].SegmentFlightTime) * (nowtime - timetable[segmentnumber]); currentLocation.CurrentFuel = FXJHTP[segmentnumber].RemainingFuel - FXJHTP[segmentnumber].SegmentFlightFuelConsumption * (nowtime - timetable[segmentnumber]); } else { currentLocation.CurrentLon = FXJHTP[0].TurningPointLongitude; currentLocation.CurrentLat = FXJHTP[0].TurningPointLatitude; currentLocation.CurrentHei = FXJHTP[0].TurningPointHeight; currentLocation.Currentvelo = 0; currentLocation.CurrentFuel = FXJHTP[segmentnumber - 1].RemainingFuel - FXJHTP[segmentnumber - 1].SegmentFlightFuelConsumption * FXJHTP[segmentnumber - 1].SegmentFlightTime; } return currentLocation; } } }