修改模拟飞行时降落不能多次双击模拟bug
修改前一个是返航点时,双击模拟时飞机位置不正确bug 3d地面飞机改为白色 修改启动界面更好看点
This commit is contained in:
parent
6f33c3867c
commit
8990d57212
@ -492,10 +492,19 @@ namespace Plane.FormationCreator.Formation
|
||||
}
|
||||
else
|
||||
{
|
||||
//用前一个任务目标位置
|
||||
lat = Tasks[SelectedTaskIndex-1].SingleCopterInfos[j].TargetLat;
|
||||
lng = Tasks[SelectedTaskIndex-1].SingleCopterInfos[j].TargetLng;
|
||||
//返航点直接设置起飞位置
|
||||
if (Tasks[SelectedTaskIndex - 1].SingleCopterInfos[j].IsLandWaypoint)
|
||||
{
|
||||
lat = Tasks[0].SingleCopterInfos[j].TargetLat;
|
||||
lng = Tasks[0].SingleCopterInfos[j].TargetLng;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//用前一个任务目标位置
|
||||
lat = Tasks[SelectedTaskIndex - 1].SingleCopterInfos[j].TargetLat;
|
||||
lng = Tasks[SelectedTaskIndex - 1].SingleCopterInfos[j].TargetLng;
|
||||
}
|
||||
|
||||
//如果前一个是起飞任务,没有目标高度,用当前的
|
||||
if (Tasks[SelectedTaskIndex - 1].TaskType == FlightTaskType.TakeOff)
|
||||
@ -529,7 +538,7 @@ namespace Plane.FormationCreator.Formation
|
||||
public async Task ResetTasks()
|
||||
{
|
||||
var copters = _copterManager.Copters;
|
||||
|
||||
if (Tasks.Count == 0) return;
|
||||
if (TaskState == TasksStatus.Running)
|
||||
{
|
||||
|
||||
|
@ -36,8 +36,34 @@ namespace Plane.FormationCreator.Formation
|
||||
DateTime dtLastTime = DateTime.Now;
|
||||
TimeSpan ts = dtNow - dtLastTime;
|
||||
int waittime = (int)info.LandWaitTime * 1000;
|
||||
await Task.Delay(waittime).ConfigureAwait(false);
|
||||
|
||||
while (ts.TotalMilliseconds < waittime)
|
||||
{
|
||||
if (_flightTaskManager.IsPaused == true)
|
||||
{
|
||||
await info.Copter.HoverAsync();
|
||||
return;
|
||||
|
||||
}
|
||||
await Task.Delay(100).ConfigureAwait(true);
|
||||
|
||||
dtNow = DateTime.Now;
|
||||
ts = dtNow - dtLastTime;
|
||||
}
|
||||
await info.Copter.LandAsync();
|
||||
while ((info.Copter.Altitude>0.0f))
|
||||
{
|
||||
if (_flightTaskManager.IsPaused == true)
|
||||
{
|
||||
await info.Copter.HoverAsync();
|
||||
return;
|
||||
|
||||
}
|
||||
await Task.Delay(100).ConfigureAwait(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 238 KiB |
@ -133,6 +133,7 @@ namespace Plane.FormationCreator.ViewModels
|
||||
var meshBuilderwaypoint = new MeshBuilder(false, false);
|
||||
|
||||
//meshBuilderwaypoint.AddTriangle(new Point3D(-0.1, -0.1, 0), new Point3D(0.1, -0.1, 0), new Point3D(0, 0.2, 0));
|
||||
//飞机点的大小形状
|
||||
meshBuilderwaypoint.AddSphere(new Point3D(0, 0, 0), 0.3);
|
||||
var meshwaypoint = meshBuilderwaypoint.ToMesh(true);
|
||||
|
||||
@ -178,7 +179,13 @@ namespace Plane.FormationCreator.ViewModels
|
||||
|
||||
if (copter.LEDColor != null && copter.LEDColor != "")
|
||||
{
|
||||
Color color = (Color)ColorConverter.ConvertFromString("#" + copter.LEDColor);
|
||||
|
||||
Color color;
|
||||
//3D在地面不能显示黑色,要不看不清楚
|
||||
if (copter.Altitude==0.0f)
|
||||
color = (Color)ColorConverter.ConvertFromString("#FFFFFF");
|
||||
else
|
||||
color = (Color)ColorConverter.ConvertFromString("#" + copter.LEDColor);
|
||||
panle3D.Material = MaterialHelper.CreateMaterial(color);
|
||||
panle3D.BackMaterial = MaterialHelper.CreateMaterial(color);
|
||||
}
|
||||
|
@ -21,15 +21,15 @@
|
||||
Command="{Binding RunTasksCommand}">
|
||||
<Button.Template>
|
||||
<ControlTemplate>
|
||||
<Grid Width="30"
|
||||
Height="30"
|
||||
<Grid Width="40"
|
||||
Height="40"
|
||||
Background="#00FFFFFF"
|
||||
VerticalAlignment="Bottom">
|
||||
<ed:RegularPolygon Fill="Black"
|
||||
<ed:RegularPolygon Fill="MidnightBlue"
|
||||
InnerRadius="1"
|
||||
PointCount="3"
|
||||
Width="30"
|
||||
Height="30"
|
||||
Width="40"
|
||||
Height="40"
|
||||
Stretch="Fill"
|
||||
Stroke="Gray">
|
||||
<ed:RegularPolygon.RenderTransform>
|
||||
@ -37,7 +37,7 @@
|
||||
<ScaleTransform />
|
||||
<SkewTransform />
|
||||
<RotateTransform Angle="90" />
|
||||
<TranslateTransform X="30" />
|
||||
<TranslateTransform X="40" />
|
||||
</TransformGroup>
|
||||
</ed:RegularPolygon.RenderTransform>
|
||||
</ed:RegularPolygon>
|
||||
@ -51,20 +51,20 @@
|
||||
Command="{Binding PauseTasksCommand}">
|
||||
<Button.Template>
|
||||
<ControlTemplate>
|
||||
<Grid Width="30"
|
||||
Height="30"
|
||||
<Grid Width="40"
|
||||
Height="40"
|
||||
VerticalAlignment="Bottom"
|
||||
Background="#00FFFFFF">
|
||||
<Rectangle Fill="Black"
|
||||
<Rectangle Fill="Red"
|
||||
HorizontalAlignment="Left"
|
||||
Width="10"
|
||||
Height="30"
|
||||
Width="15"
|
||||
Height="40"
|
||||
Stroke="Gray" />
|
||||
<Rectangle Fill="Black"
|
||||
<Rectangle Fill="Red"
|
||||
Margin="0,0,3,0"
|
||||
HorizontalAlignment="Right"
|
||||
Width="10"
|
||||
Height="30"
|
||||
Width="15"
|
||||
Height="40"
|
||||
Stroke="Gray" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
|
Loading…
Reference in New Issue
Block a user