diff --git a/src/SampleApp.WinDesktop/MainWindow.xaml b/src/SampleApp.WinDesktop/MainWindow.xaml index fae7178..f77b176 100644 --- a/src/SampleApp.WinDesktop/MainWindow.xaml +++ b/src/SampleApp.WinDesktop/MainWindow.xaml @@ -35,7 +35,7 @@ - + diff --git a/src/SampleApp.WinDesktop/SatelliteSnr.xaml b/src/SampleApp.WinDesktop/SatelliteSnr.xaml index 410b701..981f6d1 100644 --- a/src/SampleApp.WinDesktop/SatelliteSnr.xaml +++ b/src/SampleApp.WinDesktop/SatelliteSnr.xaml @@ -6,7 +6,7 @@ xmlns:local="clr-namespace:SampleApp.WinDesktop" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> - + @@ -27,6 +27,7 @@ Stretch="Fill" Data="M0,0 L 1,0 M 0,1 L 1,1 M 0,2 L 1,2 M 0,3 L 1,3 M 0,4 L 1,4" /> + @@ -37,6 +38,7 @@ + @@ -48,7 +50,7 @@ - + diff --git a/src/SampleApp.WinDesktop/SatelliteSnr.xaml.cs b/src/SampleApp.WinDesktop/SatelliteSnr.xaml.cs index e9df18c..cb8e720 100644 --- a/src/SampleApp.WinDesktop/SatelliteSnr.xaml.cs +++ b/src/SampleApp.WinDesktop/SatelliteSnr.xaml.cs @@ -2,6 +2,7 @@ using NmeaParser.Messages; using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -43,4 +44,20 @@ namespace SampleApp.WinDesktop satellites.ItemsSource = messages.Values.SelectMany(g => g.SVs); } } + public class SnrToHeightConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if(value is SatelliteVehicle sv) + { + return Math.Max(10, sv.SignalToNoiseRatio * 2); + } + return value; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } }