|
@@ -13,6 +13,7 @@ public class AircraftDY : AircraftEntity
|
|
|
public bool IsOver;
|
|
|
public bool Success;
|
|
|
public TaskParameter taskParameter;
|
|
|
+ public GetNCData getNCData;
|
|
|
public override void End()
|
|
|
{
|
|
|
TotalFuelConsumption = TurningPoints[0].RemainingFuel - TurningPoints[^1].RemainingFuel;
|
|
@@ -28,6 +29,16 @@ public class AircraftDY : AircraftEntity
|
|
|
|
|
|
public override void Start()
|
|
|
{
|
|
|
+ getNCData = new GetNCData();
|
|
|
+ getNCData.initlatitudes = FlightPlanEditor.targetpoint[0].TargetPointLatitude;
|
|
|
+ getNCData.initlongitudes = FlightPlanEditor.targetpoint[0].TargetPointLongitude;
|
|
|
+ getNCData.GetData();
|
|
|
+ Text_readNC text_ReadNC = new Text_readNC();
|
|
|
+ text_ReadNC.initlatitudes = FlightPlanEditor.targetpoint[0].TargetPointLatitude;
|
|
|
+ text_ReadNC.initlongitudes = FlightPlanEditor.targetpoint[0].TargetPointLongitude;
|
|
|
+ //text_ReadNC = new Text_readNC();
|
|
|
+ text_ReadNC.GetNCData();
|
|
|
+
|
|
|
int hour = Convert.ToInt32(taskContent.missionInformation.StartTime.Split("时")[0]);
|
|
|
//Console.WriteLine("hour:" + hour);
|
|
|
double windSpeed = Convert.ToDouble(TargetQiXiangInfoSave("风速", hour));
|
|
@@ -40,15 +51,6 @@ public class AircraftDY : AircraftEntity
|
|
|
FlightPlanEditor.missionpoint.MissionPointHeight = FlightPlanEditor.targetpoint[0].TargetPointHeight;
|
|
|
//Console.WriteLine("Latitude:" + FlightPlanEditor.missionpoint.MissionPointLatitude + "_" + "Longitude:" + FlightPlanEditor.missionpoint.MissionPointLongitude + "_" + "Height:" + FlightPlanEditor.missionpoint.MissionPointHeight);
|
|
|
|
|
|
- // 飞到目标点时间与人员存活时间做对比 有一个人活着,整个任务成功
|
|
|
- //double survivalTime = SurvivalTimeModel.SurvivalTime(getNCData.tempreadNC, latitude, longitude, time, text_ReadNC.times, text_ReadNC.latitudes, text_ReadNC.longitudes, Days, Hour); //幸存时间
|
|
|
- // 陆上搜寻预期存活时间读配置文件
|
|
|
- //for (int i = 0; i < TurningPoints.Count - 1; i++) // 总飞行时间
|
|
|
- //{
|
|
|
- // TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间 // 判断幸存-1
|
|
|
- //}
|
|
|
- // 类型只有人,其它不影响任务成功率 ,所有目标都影响识别成功率 任务准备时间 分钟 平均搜索时间 小时 平均救助时间 秒 总飞行时间 小时 第一列加单位
|
|
|
-
|
|
|
FXJHGenerate.FromStartToMission(FlightPlanEditor, ref TurningPoints);//生成从起点到任务段起点的航路点
|
|
|
// 吊运上升速度 吊运下降速度 Task文件读取 // Editor里读天气根据时间
|
|
|
double resulttime = get_result_time_rope(taskParameter.Height, taskParameter.liftPersonnel, windSpeed, vis, taskParameter.liftUpSpeed, taskParameter.liftDownSpeed).time;//索滑降模型输出的索滑降时间
|
|
@@ -58,13 +60,64 @@ public class AircraftDY : AircraftEntity
|
|
|
FXJHGenerate.FromMissionToEnd(FlightPlanEditor, FXJHGenerate.SuoHuaJiangMissionEndPoint(FlightPlanEditor), ref TurningPoints);
|
|
|
FXJHGenerate.FXJHTPDiedai(FlightPlanEditor, ref TurningPoints, Velocitys, FuelConsumptions);
|
|
|
|
|
|
+ // 飞到目标点时间与人员存活时间做对比 有一个人活着,整个任务成功
|
|
|
+ double time = 0;
|
|
|
+ for (int i = 0; i < TurningPoints.Count - 1; i++) // 总飞行时间
|
|
|
+ {
|
|
|
+ time += TurningPoints[i].SegmentFlightTime; // 总时间 // 判断幸存-1
|
|
|
+ }
|
|
|
+ isSea = true;
|
|
|
+ //isLand = true;
|
|
|
+ if (isSea)
|
|
|
+ {
|
|
|
+ if (FlightPlanEditor.targetpoint[0].TargetType.Type == "落水人员")
|
|
|
+ {
|
|
|
+ double latitude = FlightPlanEditor.targetpoint[0].TargetPointLatitude; //落水人员纬度;数据测试用
|
|
|
+ double longitude = FlightPlanEditor.targetpoint[0].TargetPointLongitude; //落水人员经度,数据测试用
|
|
|
+ int Days;
|
|
|
+ int Hour;
|
|
|
+ int Year = Convert.ToInt32(taskContent.missionInformation.StartDate.Split("年")[0]);
|
|
|
+ int Month = Convert.ToInt32(taskContent.missionInformation.StartDate.Split("年")[1].Split("月")[0]);
|
|
|
+ int Day = Convert.ToInt32(taskContent.missionInformation.StartDate.Split("年")[1].Split("月")[1].Split("日")[0]);
|
|
|
+ Hour = Convert.ToInt32(taskContent.missionInformation.StartTime.Split("时")[0]);
|
|
|
+ Days = GetDaysInYear(Year, Month, Day);
|
|
|
+ double survivalTime = SurvivalTimeModel.SurvivalTime(getNCData.tempreadNC, latitude, longitude, time, text_ReadNC.times, text_ReadNC.latitudes, text_ReadNC.longitudes, Days, Hour); //幸存时间
|
|
|
+ Console.WriteLine("survivalTime:" + survivalTime);
|
|
|
+ if (survivalTime * 3600 > time)
|
|
|
+ {
|
|
|
+ Success = true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Success = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else if(isLand) //陆上搜寻预期存活时间读配置文件
|
|
|
+ {
|
|
|
+ if (FlightPlanEditor.targetpoint[0].TargetType.Type == "遇险人员")
|
|
|
+ {
|
|
|
+ //Console.WriteLine("time:" + time);
|
|
|
+ if (FlightPlanEditor.targetpoint[0].TargetType.LiveTime > time)
|
|
|
+ {
|
|
|
+ Success = true;
|
|
|
+ //Console.WriteLine("Success:" + true);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ Success = false;
|
|
|
+ //Console.WriteLine("Success:" + false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 类型只有人,其它不影响任务成功率 ,所有目标都影响识别成功率 任务准备时间 分钟 平均搜索时间 小时 平均救助时间 秒 总飞行时间 小时 第一列加单位
|
|
|
+
|
|
|
for (int i = 0; i < TurningPoints.Count; i++) // 总飞行时间
|
|
|
{
|
|
|
TotalTime += TurningPoints[i].SegmentFlightTime; // 总时间 //仿真轮次1 数值1
|
|
|
}
|
|
|
Console.WriteLine("TotalTime:" + TotalTime);
|
|
|
IsOver = true;
|
|
|
- Success = true;
|
|
|
End();
|
|
|
}
|
|
|
|
|
@@ -165,6 +218,26 @@ public class AircraftDY : AircraftEntity
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ public static int GetDaysInYear(int year, int month, int day)
|
|
|
+ {
|
|
|
+ int[] daysInMonths = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
|
|
+ if (IsLeapYear(year))
|
|
|
+ {
|
|
|
+ daysInMonths[1] = 29;
|
|
|
+ }
|
|
|
+ int days = day;
|
|
|
+ for (int i = 0; i < month - 1; i++)
|
|
|
+ {
|
|
|
+ days += daysInMonths[i];
|
|
|
+ }
|
|
|
+ return days;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static bool IsLeapYear(int year)
|
|
|
+ {
|
|
|
+ return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public class handling_result
|