RTK按钮取消

This commit is contained in:
xu 2020-03-06 17:43:33 +08:00
parent 911024c0ad
commit da086831bf
9 changed files with 58 additions and 41 deletions

View File

@ -34,7 +34,7 @@
<cnv:InverseBooleanConverter x:Key="InverseBooleanConverter" />
<cnv:BooleanToStringConverter x:Key="ShowModifyTaskViewButtonContentConverter"
False="【飞行模式】"
True="【编辑模式】" />
True="【设计模式】" />
<cnv:BooleanToStringConverter x:Key="Show2d3dButtonContentConverter"
False="平面视图"

View File

@ -41,7 +41,7 @@ namespace Plane.FormationCreator
}
}
private bool _ShowModifyTaskView = true;
private bool _ShowModifyTaskView = false;
public bool ShowModifyTaskView
{
get { return _ShowModifyTaskView; }

View File

@ -1,6 +1,7 @@
using GalaSoft.MvvmLight;
using Microsoft.Practices.ServiceLocation;
using Plane.CommunicationManagement;
using Plane.FormationCreator.ViewModels;
using Plane.Util;
using Plane.Windows.IniHelper;
using Plane.Windows.Messages;
@ -25,12 +26,23 @@ namespace Plane.FormationCreator.Formation
private ICommsSerial comPort;
private CommModuleManager _commModuleManager = CommModuleManager.Instance;
public ObservableCollection<RtcmInfo> rtcmInfoList { get; } = new ObservableCollection<RtcmInfo>();
private ControlPanelViewModel ControlPanelVM = ServiceLocator.Current.GetInstance<ControlPanelViewModel>();
private bool _rtcmthreadrun = false;
public bool Rtcmthreadrun
{
get { return _rtcmthreadrun; }
set { Set(nameof(Rtcmthreadrun), ref _rtcmthreadrun, value); }
set {
Set(nameof(Rtcmthreadrun), ref _rtcmthreadrun, value);
if (value)
ControlPanelVM.RTKState = "RTK发送中...";
else
ControlPanelVM.RTKState = "RTK未发送";
}
}
private int bps;
@ -228,7 +240,15 @@ namespace Plane.FormationCreator.Formation
break;
}
msgseen.Clear();
comPort.Open();
try
{
comPort.Open();
}
catch (Exception ex)
{
//Message.Show(ex.Message);
}
if (comPort.IsOpen)
{
Rtcmthreadrun = true;

View File

@ -45,7 +45,7 @@
<c:MetroWindow.RightWindowCommands>
<c:WindowCommands>
<Button Content="{Binding LoginDisp}"
Command="{Binding LoginCommand}" />

View File

@ -1153,9 +1153,10 @@ namespace Plane.FormationCreator.ViewModels
Alert.Show("作为参照的原点未设置,无法开始任务!", "提示");
return;
}
//飞机用UTC时间日志用本地时间记录
DateTime MissionTime = DateTime.UtcNow.AddSeconds(5);
Message.Show("开始任务"+ MissionTime.ToString());
DateTime MissionTime_log = DateTime.Now.AddSeconds(5);
Message.Show("任务开始:" + MissionTime_log.ToString());
//循环3次 发送起飞命令 避免通信问题
for (int i = 0; i < 10; i++)
{
@ -1182,7 +1183,7 @@ namespace Plane.FormationCreator.ViewModels
await Task.Delay(10).ConfigureAwait(false);
}
_copterManager.Net_LogStartMission(MissionTime, _flightTaskManager.OriginLng, _flightTaskManager.OriginLat);
_copterManager.Net_LogStartMission(MissionTime_log, _flightTaskManager.OriginLng, _flightTaskManager.OriginLat);
Alert.Show("所有飞机开始执行航点任务。请勿多次开始任务!", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
}));
}

View File

@ -12,7 +12,7 @@
d:DesignHeight="300"
d:DesignWidth="300">
<StackPanel>
<StackPanel Margin="0,0,-8,0">
<StackPanel.Resources>
<Style TargetType="Button"
BasedOn="{StaticResource {x:Type Button}}">
@ -79,25 +79,20 @@
Text="{Binding AltP, UpdateSourceTrigger=PropertyChanged}" />
</WrapPanel>
<WrapPanel>
<Button Content="选写航点"
Command="{Binding WriteMissionSingleCommand}" />
<Button Content="定位统计"
Command="{Binding ReportGPSTypeCommand}"/>
<Button Content="统计模块"
Command="{Binding DetectionCommModuleVersion}" />
<Button Content="正式参数"
Command="{Binding TurnOffTestLightsCommand}"
/>
<TextBlock Margin="5,0,3,0" Text="起飞高度" VerticalAlignment="Center"></TextBlock>
<TextBox Width="30" Height="26" Text="{Binding TaskOffAlt}"
/>
<Button Margin="0,0,0,0" Content="选写航点" Command="{Binding WriteMissionSingleCommand}" />
<Button Margin="3,0,0,0" Content="定位统计" Command="{Binding ReportGPSTypeCommand}"/>
<Button Margin="3,0,0,0" Content="统计模块" Command="{Binding DetectionCommModuleVersion}" />
<Button Margin="3,0,0,0" Content="正式参数" Command="{Binding TurnOffTestLightsCommand}" />
<TextBlock Margin="8,0,5,0" Text="起飞高度" VerticalAlignment="Center"></TextBlock>
<TextBox Width="30" Height="25" Text="{Binding TaskOffAlt}" />
<TextBlock Margin="5,0,5,0" Text="米" VerticalAlignment="Center"></TextBlock>
<Label Visibility="Collapsed">Lat</Label>
<TextBox Visibility="Collapsed" Text="{Binding LatOffset}" Width="50"/>
<Label Visibility="Collapsed">Lng</Label>
<TextBox Visibility="Collapsed" Text="{Binding LngOffset}" Width="50"/>
<Button Visibility="Collapsed" Content="设置返航点"
Command="{Binding RLTOffsetCommand}" />
<Button Visibility="Collapsed" Content="设置返航点" Command="{Binding RLTOffsetCommand}" />
</WrapPanel>
<Separator/>
<WrapPanel>
@ -135,19 +130,20 @@
Width="55"
Margin="5, 5, 5, 5"
HorizontalContentAlignment="Right"
Text="{Binding RTKcomvalue, UpdateSourceTrigger=PropertyChanged}"
Text="{Binding RTKcomvalue, UpdateSourceTrigger=PropertyChanged}" Visibility="Collapsed"
/>
<Button Content="{Binding Path=RTKbtntxt}"
Command="{Binding SendRTKCommand}" />
Command="{Binding SendRTKCommand}" Visibility="Collapsed" />
<Button Content="{Binding Path=NTRIPbtntxt}"
Command="{Binding SendRTCMCommand}"/>
Command="{Binding SendRTCMCommand}" Visibility="Collapsed"/>
<Button Content="RTK" Command="{Binding OpenRtcmManageCommand}" />
<Button Content="RTK 控制" Command="{Binding OpenRtcmManageCommand}" />
<TextBlock
Margin="5,5,5,5"
Margin="5,5,5,5" Foreground ="Red" VerticalAlignment="Center"
Text="{Binding Path=RTKState}"
/>
</WrapPanel>

View File

@ -84,13 +84,13 @@
</ListBox.ItemTemplate>
</ListBox>
<StackPanel Grid.Row="1" Margin="0,0,0,5"
<StackPanel Grid.Row="1" Margin="0,5,0,5"
Orientation="Horizontal">
<Button Content="间隔选" Command="{Binding IntervalSelectCoptersCommand}"/>
<Button Content="间隔选" Command="{Binding IntervalSelectCoptersCommand}"/>
<TextBlock Text="连选数量" Margin="5,5,0,0"/>
<TextBox Width="30" Margin="5,0,0,0" Text="{Binding ContinuousNum}"/>
<TextBox Width="30" Margin="5,0" VerticalContentAlignment="Center" Text="{Binding ContinuousNum}"/>
<TextBlock Text="间隔数量" Margin="5,5,0,0"/>
<TextBox Width="30" Margin="5,0,0,0" Text="{Binding IntervalNum}"/>
<TextBox Width="30" Margin="5,0" VerticalContentAlignment="Center" Text="{Binding IntervalNum}"/>
<TextBlock Text="选中个数" Margin="5,5,0,0"/>
<TextBlock Width="30" Margin="5,5,0,0" Text="{Binding CopterManager.SeletedCopterCount, UpdateSourceTrigger=PropertyChanged}"/>

View File

@ -7,7 +7,7 @@
xmlns:c="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="800"
Height="350" Width="1500" WindowStartupLocation="CenterScreen" Background="#FF2D2D2D" BorderBrush="#FF039AF0">
Height="350" Width="1500" WindowStartupLocation="CenterScreen" Background="#FF2D2D2D" BorderBrush="#FF039AF0" Title="RTK控制">
<Grid Margin="0,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
@ -15,7 +15,7 @@
</Grid.RowDefinitions>
<StackPanel Margin="5" Orientation="Horizontal" VerticalAlignment="Center">
<ComboBox Width="120" Height="25" Foreground="White" SelectedIndex="0"
ItemsSource="{Binding serialPorts, Mode=OneWay}"
Margin="10" ItemsSource="{Binding serialPorts, Mode=OneWay}"
SelectedValue="{Binding SerialPortsSelectdValue}"
DropDownOpened="ComboBox_DropDownOpened"/>
<Button Margin="6" Width="80" Height="28"

View File

@ -5,17 +5,17 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Plane.FormationCreator.Views"
mc:Ignorable="d"
Title="设置摆放" Height="301.595" Width="364.628" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize">
<Grid Margin="90,45">
Title="设置摆放" Height="290.592" Width="364.628" WindowStartupLocation="CenterScreen" WindowStyle="ToolWindow" ResizeMode="NoResize">
<Grid Margin="90,35,90,20">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="28"/>
<RowDefinition Height="32"/>
<RowDefinition Height="32"/>
<RowDefinition Height="32"/>
<RowDefinition Height="32"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Content="每列数量" Margin="5,2"></Label>