2014-07-25 21:21:07 +02:00
|
|
|
<Window x:Class="SampleApp.WinDesktop.MainWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
2020-01-29 05:44:16 +01:00
|
|
|
xmlns:local="clr-namespace:SampleApp.WinDesktop"
|
|
|
|
|
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
|
2014-11-15 09:10:24 +01:00
|
|
|
Title="Sample App" Height="500" Width="625">
|
2017-03-15 06:55:00 +01:00
|
|
|
<Window.Resources>
|
|
|
|
|
<local:NullToCollapsedConverter x:Key="nullConv" />
|
|
|
|
|
<Style TargetType="UserControl" x:Key="card">
|
|
|
|
|
<Setter Property="Margin" Value="10" />
|
|
|
|
|
<Setter Property="Padding" Value="10" />
|
|
|
|
|
<Setter Property="Background" Value="White" />
|
|
|
|
|
<Setter Property="Effect">
|
|
|
|
|
<Setter.Value>
|
|
|
|
|
<DropShadowEffect Direction="0" ShadowDepth="0"
|
2020-01-29 05:44:16 +01:00
|
|
|
BlurRadius="20" Opacity=".5" />
|
2017-03-15 06:55:00 +01:00
|
|
|
</Setter.Value>
|
|
|
|
|
</Setter>
|
|
|
|
|
</Style>
|
|
|
|
|
</Window.Resources>
|
|
|
|
|
<Grid>
|
2020-01-29 05:44:16 +01:00
|
|
|
<TabControl>
|
|
|
|
|
<TabItem Header="GPS Info">
|
|
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="Disabled" Background="#FFEEEEEE">
|
|
|
|
|
<WrapPanel x:Name="MessagePanel">
|
|
|
|
|
<local:GprmcControl x:Name="gprmcView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gprmcView, Converter={StaticResource nullConv}}" />
|
|
|
|
|
<local:GpggaControl x:Name="gpggaView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpggaView, Converter={StaticResource nullConv}}" />
|
|
|
|
|
<local:GpgsaControl x:Name="gpgsaView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpgsaView, Converter={StaticResource nullConv}}" />
|
|
|
|
|
<local:GpgllControl x:Name="gpgllView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=gpgllView, Converter={StaticResource nullConv}}" />
|
|
|
|
|
<local:PgrmeControl x:Name="pgrmeView" Style="{StaticResource card}" Visibility="{Binding Message, ElementName=pgrmeView, Converter={StaticResource nullConv}}" />
|
|
|
|
|
</WrapPanel>
|
|
|
|
|
</ScrollViewer>
|
|
|
|
|
</TabItem>
|
|
|
|
|
<TabItem Header="GPS Satellite view">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition />
|
|
|
|
|
<RowDefinition Height="100" />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<local:SatelliteView MaxWidth="{Binding ActualHeight, ElementName=satView}"
|
|
|
|
|
Grid.Column="1" x:Name="satView" />
|
|
|
|
|
<local:SatelliteSnr Grid.Row="1"
|
|
|
|
|
GsvMessage="{Binding GsvMessage, ElementName=satView}" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</TabItem>
|
|
|
|
|
<TabItem Header="Map">
|
|
|
|
|
<Grid>
|
|
|
|
|
<!--Map-->
|
|
|
|
|
<esri:MapView x:Name="mapView" Grid.Row="1">
|
|
|
|
|
<local:RestoreAutoPanMode.RestoreAutoPanSettings>
|
|
|
|
|
<local:RestoreAutoPanMode DelayInSeconds="2.5" PanMode="Navigation" IsEnabled="True" RestoreScale="5000" />
|
|
|
|
|
</local:RestoreAutoPanMode.RestoreAutoPanSettings>
|
|
|
|
|
</esri:MapView>
|
|
|
|
|
|
|
|
|
|
<!--North arrow-->
|
|
|
|
|
<Grid Width="50" Height="50" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
|
|
|
|
Margin="20" RenderTransformOrigin=".5,.5">
|
|
|
|
|
<Grid.Resources>
|
|
|
|
|
<local:ReverseConverter x:Key="conv" />
|
|
|
|
|
</Grid.Resources>
|
|
|
|
|
<Grid.Effect>
|
|
|
|
|
<DropShadowEffect Direction="0" ShadowDepth="0"
|
|
|
|
|
BlurRadius="10" Opacity=".75" />
|
|
|
|
|
</Grid.Effect>
|
|
|
|
|
<Grid.RenderTransform>
|
|
|
|
|
<RotateTransform Angle="{Binding ElementName=mapView, Path=MapRotation, Converter={StaticResource conv}}" />
|
|
|
|
|
</Grid.RenderTransform>
|
|
|
|
|
<TextBlock Text="Ù" FontFamily="Wingdings" HorizontalAlignment="Center" VerticalAlignment="Center"
|
|
|
|
|
FontSize="40" Foreground="White" />
|
|
|
|
|
<TextBlock Text="N" HorizontalAlignment="Center" VerticalAlignment="Top"
|
|
|
|
|
FontSize="12" Margin="0,-5,0,0" RenderTransformOrigin=".5,.5"
|
|
|
|
|
Foreground="White" >
|
|
|
|
|
<TextBlock.RenderTransform>
|
|
|
|
|
<RotateTransform Angle="{Binding ElementName=mapView, Path=MapRotation}" />
|
|
|
|
|
</TextBlock.RenderTransform>
|
|
|
|
|
</TextBlock>
|
|
|
|
|
</Grid>
|
|
|
|
|
|
|
|
|
|
<Grid HorizontalAlignment="Right" VerticalAlignment="Top"
|
|
|
|
|
Margin="10" Background="White" Width="150"
|
|
|
|
|
DataContext="{Binding ElementName=mapView, Path=LocationDisplay.Location}">
|
|
|
|
|
<Grid.Effect>
|
|
|
|
|
<DropShadowEffect Direction="0" ShadowDepth="0"
|
|
|
|
|
BlurRadius="10" Opacity=".75" />
|
|
|
|
|
</Grid.Effect>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition />
|
|
|
|
|
<ColumnDefinition />
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition />
|
|
|
|
|
<RowDefinition />
|
|
|
|
|
<RowDefinition />
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Border Background="CornflowerBlue" Grid.ColumnSpan="2" Padding="10">
|
|
|
|
|
<TextBlock Text="Details" FontSize="20" FontWeight="Bold" Foreground="White" />
|
|
|
|
|
</Border>
|
|
|
|
|
<StackPanel Margin="10" Grid.Row="1">
|
|
|
|
|
<TextBlock Text="Speed:" FontWeight="Bold" />
|
|
|
|
|
<TextBlock Text="Course:" FontWeight="Bold" />
|
|
|
|
|
<TextBlock Text="Altitude:" FontWeight="Bold" />
|
|
|
|
|
<TextBlock Text="Accuracy:" FontWeight="Bold" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<StackPanel Margin="0,10,10,10" Grid.Column="1" Grid.Row="1">
|
|
|
|
|
<TextBlock Text="{Binding Velocity, StringFormat='{}{0} km/h'}" />
|
|
|
|
|
<TextBlock Text="{Binding Course, StringFormat='{}{0}°'}" />
|
|
|
|
|
<TextBlock Text="{Binding Position.Z, StringFormat='{}{0} m'}" />
|
|
|
|
|
<TextBlock Text="{Binding HorizontalAccuracy, StringFormat='{}{0} m'}" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<local:AltitudeGraph Grid.Row="2" Grid.ColumnSpan="2" Height="50" x:Name="altitude" Value="{Binding Position.Z}" />
|
|
|
|
|
</Grid>
|
|
|
|
|
</Grid>
|
|
|
|
|
</TabItem>
|
|
|
|
|
<TabItem Header="Messages">
|
|
|
|
|
<TextBox x:Name="output"
|
|
|
|
|
AcceptsReturn="True"
|
|
|
|
|
IsReadOnly="True"
|
|
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
|
|
HorizontalScrollBarVisibility="Visible"
|
|
|
|
|
/>
|
|
|
|
|
</TabItem>
|
|
|
|
|
<TabItem Header="Device">
|
|
|
|
|
<Grid>
|
|
|
|
|
<StackPanel Margin="10">
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<TextBlock Text="Current device: " />
|
|
|
|
|
<TextBlock Text="None" x:Name="currentDeviceInfo" FontWeight="Bold" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<Button Width="200" Content="Open NMEA Log..." Click="OpenNmeaLogButton_Click" HorizontalAlignment="Left" Padding="20,5" Margin="0,5" />
|
|
|
|
|
<StackPanel Orientation="Horizontal">
|
|
|
|
|
<Button Width="200" Content="Auto-discover serial port"
|
|
|
|
|
HorizontalAlignment="Left" Padding="20,5" Margin="0,5"
|
|
|
|
|
Click="AutoDiscoverButton_Click" />
|
|
|
|
|
<TextBlock x:Name="autoDiscoverStatus" VerticalAlignment="Center" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
<GroupBox Header="Open Serial device" Width="200" HorizontalAlignment="Left">
|
|
|
|
|
<StackPanel>
|
|
|
|
|
<TextBlock Text="Serial port:" />
|
|
|
|
|
<ComboBox x:Name="serialPorts" />
|
|
|
|
|
<TextBlock Text="Baud rate:" />
|
|
|
|
|
<ComboBox x:Name="baudRates" SelectedIndex="3">
|
|
|
|
|
<ComboBoxItem>1200</ComboBoxItem>
|
|
|
|
|
<ComboBoxItem>2400</ComboBoxItem>
|
|
|
|
|
<ComboBoxItem>4800</ComboBoxItem>
|
|
|
|
|
<ComboBoxItem>9600</ComboBoxItem>
|
|
|
|
|
<ComboBoxItem>19200</ComboBoxItem>
|
|
|
|
|
<ComboBoxItem>38400</ComboBoxItem>
|
|
|
|
|
<ComboBoxItem>57600</ComboBoxItem>
|
|
|
|
|
<ComboBoxItem>115200</ComboBoxItem>
|
|
|
|
|
</ComboBox>
|
|
|
|
|
<Button Content="Connect" HorizontalAlignment="Left" Padding="20,5" Margin="0,5" Click="ConnectToSerialButton_Click" />
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</GroupBox>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
</TabItem>
|
|
|
|
|
</TabControl>
|
|
|
|
|
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
|
|
|
|
</Grid>
|
2014-07-25 21:21:07 +02:00
|
|
|
</Window>
|