瀏覽代碼

修复bug

zansimple 8 月之前
父節點
當前提交
6388f490e6
共有 1 個文件被更改,包括 22 次插入11 次删除
  1. 22 11
      SimulationServer/Entity/AircraftSJ.cs

+ 22 - 11
SimulationServer/Entity/AircraftSJ.cs

@@ -74,7 +74,7 @@ public class AircraftSJ : AircraftEntity
             waypoints = SectorSearch.PerformSearch(taskContent.SearchWidth);
         }
 
-        if (taskContent.SearchMode == "拓展方形搜索")
+        if (taskContent.SearchMode == "扩展矩形搜索")
         {
             waypoints = TZFX.GenerateWaypoints(points[0], points[1], points[2], points[3], 20, taskContent.SearchWidth);
         }
@@ -95,8 +95,19 @@ public class AircraftSJ : AircraftEntity
             });
         }
 
+        // var distance = Utils.Util.GetDistance(waypoints[0].lon,FlightPlanEditor.targetpoint[0].TargetPointLongitude, waypoints[0].lat,
+        //     FlightPlanEditor.targetpoint[0].TargetPointLatitude);
+        // var distance1 = Utils.Util.GetDistance(waypoints[0].lon,FlightPlanEditor.originbase.BaseLongitude, waypoints[0].lat,
+        //     FlightPlanEditor.originbase.BaseLatitude);
+        
         FlightPlanEditor.airroute = airRoutes.ToArray();
 
+        MissionPoint missionPoint = new MissionPoint();
+        missionPoint.MissionPointLatitude = waypoints[0].lat;
+        missionPoint.MissionPointLongitude = waypoints[0].lon;
+        
+        FlightPlanEditor.missionpoint = missionPoint;
+
         FXJHGenerate.FromStartToMission(FlightPlanEditor, ref TurningPoints); //生成从起点到任务段起点的航路点
 
         FXJHGenerate.SeaSouJiu(FlightPlanEditor, ref TurningPoints);
@@ -134,18 +145,18 @@ public class AircraftSJ : AircraftEntity
                 var waveHigh = SeaSJ.GetWaveHeightFromAPI(nCread, currentLocation.CurrentLon,
                     currentLocation.CurrentLat, temptime);
 
-                // var distance = Utils.Util.GetDistance(currentLocation.CurrentLon,targetPoint.x, currentLocation.CurrentLat,
-                //     targetPoint.y);
-                // Log.Info("距离:====================" + distance);
-                // if (distance < 3)
-                // {
-                //     probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
-                //         windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
-                // }
+                var distance = Utils.Util.GetDistance(currentLocation.CurrentLon,targetPoint.x, currentLocation.CurrentLat,
+                    targetPoint.y);
+                Log.Info("距离:====================" + distance);
+                if (distance < 20)
+                {
+                    probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
+                        windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
+                }
                 
                 
-                probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
-                    windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
+                // probability = helper.getProbability(aricraftPoint, targetPoint, currentLocation.CurrentCourse,
+                //     windSpeed, waveHigh, "落水人员", "海上"); // 计算发现概率,需要其他模型输入 // 计算发现概率,需要其他模型输入
                
                 // if (taskContent.SearchMode == "雷达搜索")
                 // {