/MKLiveView/v1.0/Source/MainWindow.xaml |
---|
328,6 → 328,38 |
<DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="Transparent" /> |
</ColorAnimationUsingKeyFrames> |
</Storyboard> |
<Storyboard x:Key="SatFixLostAnim" Duration="0:0:1" RepeatBehavior="Forever"> |
<ColorAnimationUsingKeyFrames |
Storyboard.TargetName="tbTopSats" |
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"> |
<DiscreteColorKeyFrame KeyTime="0:0:0" Value="Red" /> |
<DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="Transparent" /> |
</ColorAnimationUsingKeyFrames> |
</Storyboard> |
<Storyboard x:Key="MagneticFieldCritAnim" Duration="0:0:1" RepeatBehavior="Forever"> |
<ColorAnimationUsingKeyFrames |
Storyboard.TargetName="tbTopEarthMag" |
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"> |
<DiscreteColorKeyFrame KeyTime="0:0:0" Value="Red" /> |
<DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="Transparent" /> |
</ColorAnimationUsingKeyFrames> |
</Storyboard> |
<Storyboard x:Key="DistanceCritAnim" Duration="0:0:1" RepeatBehavior="Forever"> |
<ColorAnimationUsingKeyFrames |
Storyboard.TargetName="tbTopDistanceHP" |
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"> |
<DiscreteColorKeyFrame KeyTime="0:0:0" Value="Red" /> |
<DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="Transparent" /> |
</ColorAnimationUsingKeyFrames> |
</Storyboard> |
<Storyboard x:Key="RCCritAnim" Duration="0:0:1" RepeatBehavior="Forever"> |
<ColorAnimationUsingKeyFrames |
Storyboard.TargetName="tbTopRC" |
Storyboard.TargetProperty="Background.(SolidColorBrush.Color)"> |
<DiscreteColorKeyFrame KeyTime="0:0:0" Value="Red" /> |
<DiscreteColorKeyFrame KeyTime="0:0:0.5" Value="Transparent" /> |
</ColorAnimationUsingKeyFrames> |
</Storyboard> |
<Style x:Key="HideSwitchNCLabel" TargetType="{x:Type Label}"> |
<Setter Property="Visibility" Value="Collapsed" /> |
<Style.Triggers> |
377,15 → 409,15 |
<TextBox x:Name="tbTopVoltage" HorizontalAlignment="Left" Height="25" TextWrapping="Wrap" Text="0 V" VerticalAlignment="Top" Width="76" BorderBrush="{x:Null}" FontSize="14" HorizontalContentAlignment="Center" Background="{x:Null}" Padding="1" Foreground="White" VerticalContentAlignment="Center" AllowDrop="False" Focusable="False" IsHitTestVisible="False" IsTabStop="False" IsUndoEnabled="False" IsReadOnly="True" Canvas.Left="7" Canvas.Top="1"/> |
</Canvas> |
<Canvas Margin="1,2,2,3" Width="94" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowCapacity}"> |
<TextBox x:Name="tbTopCapacity" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0 mAh" VerticalAlignment="Top" Width="94" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="{x:Null}" Padding="4,1,1,1" Foreground="White" ToolTip="capacity used" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<TextBox x:Name="tbTopCapacity" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0 mAh" VerticalAlignment="Top" Width="94" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="#00000000" Padding="4,1,1,1" Foreground="White" ToolTip="capacity used" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<Image x:Name="imageFlightTime_Copy" Height="23.835" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/Consumption.png" HorizontalAlignment="Left" Width="25.375" Canvas.Left="67.993" Canvas.Top="4"/> |
</Canvas> |
<Canvas Margin="1,2,2,3" Width="72" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowCurrent}"> |
<TextBox x:Name="tbTopCurrent" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0.0 A" VerticalAlignment="Top" Width="72" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="{x:Null}" Padding="4,1,1,1" Foreground="White" ToolTip="capacity used" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<TextBox x:Name="tbTopCurrent" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0.0 A" VerticalAlignment="Top" Width="72" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="#00000000" Padding="4,1,1,1" Foreground="White" ToolTip="capacity used" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<Image x:Name="imageFlightTime_Copy4" Height="23.835" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/Blitz.png" HorizontalAlignment="Left" Width="16.007" Canvas.Left="56.493" Canvas.Top="4"/> |
</Canvas> |
<Canvas Margin="1,2,2,3" Width="94" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowFlightTime}"> |
<TextBox x:Name="tbTopFTime" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="00:00:00" VerticalAlignment="Top" Width="94" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="{x:Null}" Padding="4,1,1,1" Foreground="White" ToolTip="flight time since motor start" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<TextBox x:Name="tbTopFTime" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="00:00:00" VerticalAlignment="Top" Width="94" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="#00000000" Padding="4,1,1,1" Foreground="White" ToolTip="flight time since motor start" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<Image x:Name="imageFlightTime" Height="25.583" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/flighttime.png" HorizontalAlignment="Left" Width="25.375" Canvas.Left="63.331" Canvas.Top="2.252"/> |
</Canvas> |
<Canvas Margin="1,2,2,3" Width="84" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowDistanceHP}"> |
400,28 → 432,28 |
</Style> |
</Rectangle.Style> |
</Rectangle> |
<TextBox x:Name="tbTopDistanceHP" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0 m" VerticalAlignment="Top" Width="84" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="{x:Null}" Padding="4,1,1,1" Foreground="White" ToolTip="distance to home position" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<Image x:Name="imageFlightTime_Copy1" Height="25.583" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/Home1.png" HorizontalAlignment="Left" Width="25.375" Canvas.Left="54.831" Canvas.Top="2.252"/> |
<TextBox x:Name="tbTopDistanceHP" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0 m" VerticalAlignment="Top" Width="84" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="#00000000" Padding="4,1,1,1" Foreground="White" ToolTip="distance to home position" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<Image x:Name="imageHome" Height="25.583" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/Home1.png" HorizontalAlignment="Left" Width="25.375" Canvas.Left="54.831" Canvas.Top="2.252"/> |
<Button x:Name="btnTopHome" Content="" Click="btnSetHP_Click" Background="{x:Null}" BorderThickness="0" BorderBrush="{x:Null}" Height="31" VerticalAlignment="Top" Foreground="{x:Null}" Focusable="False" Style="{DynamicResource ButtonWithoutEffectStyle}" ToolTip="set home position @actual position (center screen)" HorizontalAlignment="Right" Width="84"/> |
</Canvas> |
<Canvas Margin="1,2,2,3" Width="61" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowHeight}"> |
<TextBox x:Name="tbTopHeight" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0 m" VerticalAlignment="Top" Width="61" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="{x:Null}" Padding="4,1,1,1" Foreground="White" ToolTip="distance to home position" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<TextBox x:Name="tbTopHeight" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0 m" VerticalAlignment="Top" Width="61" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="#00000000" Padding="4,1,1,1" Foreground="White" ToolTip="distance to home position" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<Image x:Name="imageFlightTime_Copy2" Height="23" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/Altitude.png" HorizontalAlignment="Left" Width="8.25" Canvas.Left="48.688" Canvas.Top="4"/> |
</Canvas> |
<Canvas Margin="1,2,2,1" Width="95" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowSpeed}"> |
<TextBox x:Name="tbTopSpeed" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0.0 m/s" VerticalAlignment="Top" Width="95" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="{x:Null}" Padding="4,1,1,1" Foreground="White" ToolTip="groundspeed" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<TextBox x:Name="tbTopSpeed" HorizontalAlignment="Left" Height="31" TextWrapping="Wrap" Text="0.0 m/s" VerticalAlignment="Top" Width="95" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="#00000000" Padding="4,1,1,1" Foreground="White" ToolTip="groundspeed" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False"/> |
<Image x:Name="imageFlightTime_Copy3" Height="19.835" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/Tacho.png" HorizontalAlignment="Left" Width="29.375" Canvas.Left="63.754" Canvas.Top="6.25"/> |
</Canvas> |
<Canvas Margin="0,2,2,0" Width="83" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowMF}"> |
<TextBox x:Name="tbTopEarthMag" Height="31" TextWrapping="Wrap" Text="100%" VerticalAlignment="Top" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="{x:Null}" Padding="4,1,1,1" Foreground="White" ToolTip="earth magnetic field" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False" HorizontalAlignment="Left" Width="84"/> |
<TextBox x:Name="tbTopEarthMag" Height="31" TextWrapping="Wrap" Text="100%" VerticalAlignment="Top" BorderBrush="#FFE4E4E4" FontSize="14" VerticalContentAlignment="Center" Background="#00000000" Padding="4,1,1,1" Foreground="White" ToolTip="earth magnetic field" BorderThickness="0.5" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False" HorizontalAlignment="Left" Width="84"/> |
<Image x:Name="imageEarthMag" Height="36.75" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/EarthMag.png" HorizontalAlignment="Left" Width="36.876" Canvas.Left="46.289" Canvas.Top="0.582"/> |
</Canvas> |
<Canvas Margin="1,2,2,3" Width="56" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowSatellites}"> |
<TextBox x:Name="tbTopSats" Height="31" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Background="{x:Null}" BorderBrush="#FFE4E4E4" Foreground="#FFFFFEFE" VerticalContentAlignment="Center" FontSize="14" Padding="4,0,0,0" BorderThickness="0.5" HorizontalAlignment="Left" Width="56" IsReadOnly="True" IsUndoEnabled="False" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" ToolTip="Satellites"/> |
<TextBox x:Name="tbTopSats" Height="31" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Background="#00000000" BorderBrush="#FFE4E4E4" Foreground="#FFFFFEFE" VerticalContentAlignment="Center" FontSize="14" Padding="4,0,0,0" BorderThickness="0.5" HorizontalAlignment="Left" Width="56" IsReadOnly="True" IsUndoEnabled="False" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" ToolTip="Satellites"/> |
<Image x:Name="imageSat" Height="25.958" VerticalAlignment="Top" Stretch="Fill" UseLayoutRounding="False" Source="Images/Satellite1.png" HorizontalAlignment="Left" Width="23.583" Canvas.Left="25.667" Canvas.Top="1.752"/> |
</Canvas> |
<Canvas Margin="1,2,2,2.4" Width="62" Style="{StaticResource CanvasVisibility}" Tag="{Binding ElementName=chkBoxTopBarShowRC}"> |
<TextBox x:Name="tbTopRC" Height="31" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Background="{x:Null}" BorderBrush="#FFE4E4E4" Foreground="#FFFFFEFE" VerticalContentAlignment="Center" FontSize="14" Padding="4,0,0,0" BorderThickness="0.5" HorizontalAlignment="Left" Width="62" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False" ToolTip="RC quality"/> |
<TextBox x:Name="tbTopRC" Height="31" TextWrapping="Wrap" Text="0" VerticalAlignment="Top" Background="#00000000" BorderBrush="#FFE4E4E4" Foreground="#FFFFFEFE" VerticalContentAlignment="Center" FontSize="14" Padding="4,0,0,0" BorderThickness="0.5" HorizontalAlignment="Left" Width="62" AllowDrop="False" IsHitTestVisible="False" IsTabStop="False" IsReadOnly="True" IsUndoEnabled="False" ToolTip="RC quality"/> |
<Image x:Name="imageRC" Height="27.958" VerticalAlignment="Top" UseLayoutRounding="False" Source="Images/RC1.png" HorizontalAlignment="Left" Width="23.833" Canvas.Left="33.917" Canvas.Top="1.752"/> |
</Canvas> |
</StackPanel> |
714,12 → 746,12 |
<Button x:Name="btnGotoHP" Content="goto Home" Margin="7,477,139,0" Click="btnGotoHP_Click" Height="24" VerticalAlignment="Top"/> |
</Grid> |
</TabItem> |
<TabItem Header="Thresholds" HorizontalAlignment="Left" Height="20" VerticalAlignment="Top" Width="78" Margin="15.257,0,-39.257,0"> |
<TabItem Header="Thresholds" Height="20" VerticalAlignment="Top" Margin="13,0,-13,0" HorizontalAlignment="Left" Width="70"> |
<Grid> |
<GroupBox x:Name="groupBox2" Header="Voltage" HorizontalAlignment="Left" Height="152" Margin="10,10,0,0" VerticalAlignment="Top" Width="203" BorderThickness="0.5" Foreground="White"> |
<Grid Margin="0,0,-6,-5.96"> |
<Slider x:Name="sliderThresholdVoltageCrit" HorizontalAlignment="Left" Height="23" Margin="10,75,0,0" VerticalAlignment="Top" Width="177" Maximum="{Binding Value, ElementName=sliderThresholdVoltageWarn}" Minimum="{Binding Minimum, ElementName=sliderThresholdVoltageWarn}" ValueChanged="sliderThresholdVoltageCrit_ValueChanged" TickFrequency="0.1" IsSnapToTickEnabled="True"/> |
<Label x:Name="labelThresholdVoltageCrit" HorizontalAlignment="Left" Margin="86,49,0,0" VerticalAlignment="Top" Foreground="White" Height="25" Width="45" Content="{Binding Value, ElementName=sliderThresholdVoltageCrit}"> |
<GroupBox x:Name="groupBox2" Header="Voltage" HorizontalAlignment="Left" Height="109" Margin="10,5,0,0" VerticalAlignment="Top" Width="203" BorderThickness="0.5" Foreground="White"> |
<Grid Margin="0,0,-6,-3.96"> |
<Slider x:Name="sliderThresholdVoltageCrit" HorizontalAlignment="Left" Height="23" Margin="10,65,0,0" VerticalAlignment="Top" Width="177" Maximum="{Binding Value, ElementName=sliderThresholdVoltageWarn}" Minimum="{Binding Minimum, ElementName=sliderThresholdVoltageWarn}" ValueChanged="sliderThresholdVoltageCrit_ValueChanged" TickFrequency="0.1" IsSnapToTickEnabled="True"/> |
<Label x:Name="labelThresholdVoltageCrit" HorizontalAlignment="Left" Margin="86,41,0,0" VerticalAlignment="Top" Foreground="White" Height="25" Width="45" Content="{Binding Value, ElementName=sliderThresholdVoltageCrit}"> |
<Label.Style> |
<Style TargetType="{x:Type Label}"> |
<Style.Triggers> |
730,11 → 762,11 |
</Style> |
</Label.Style> |
</Label> |
<Label x:Name="labelThresholdVoltageCrit_Copy" Content="critical" HorizontalAlignment="Left" Margin="26,49,0,0" VerticalAlignment="Top" Foreground="White"/> |
<Slider x:Name="sliderThresholdVoltageWarn" HorizontalAlignment="Left" Height="23" Margin="10,30,0,0" VerticalAlignment="Top" Width="177" ValueChanged="sliderThresholdVoltageWarn_ValueChanged" Maximum="30" TickFrequency="0.1" IsSnapToTickEnabled="True"> |
<Label x:Name="labelThresholdVoltageCrit_Copy" Content="critical" HorizontalAlignment="Left" Margin="8,41,0,0" VerticalAlignment="Top" Foreground="White"/> |
<Slider x:Name="sliderThresholdVoltageWarn" HorizontalAlignment="Left" Height="23" Margin="10,22,0,0" VerticalAlignment="Top" Width="177" ValueChanged="sliderThresholdVoltageWarn_ValueChanged" Maximum="30" TickFrequency="0.1" IsSnapToTickEnabled="True"> |
</Slider> |
<Label x:Name="labelThresholdVoltageWarn" HorizontalAlignment="Left" Margin="86,4,0,0" VerticalAlignment="Top" Foreground="White" Height="25" Width="45" Content="{Binding Value, ElementName=sliderThresholdVoltageWarn}"> |
<Label x:Name="labelThresholdVoltageWarn" HorizontalAlignment="Left" Margin="86,-2,0,0" VerticalAlignment="Top" Foreground="White" Height="25" Width="45" Content="{Binding Value, ElementName=sliderThresholdVoltageWarn}"> |
<Label.Style> |
<Style TargetType="{x:Type Label}"> |
<Style.Triggers> |
745,11 → 777,36 |
</Style> |
</Label.Style> |
</Label> |
<Label x:Name="labelThresholdVoltageCrit_Copy2" Content="warning" HorizontalAlignment="Left" Margin="26,4,0,0" VerticalAlignment="Top" Foreground="White"/> |
<CheckBox x:Name="checkBoxThresholdVoltageVoice" Content="voice output" HorizontalAlignment="Left" Height="16" Margin="10,109,0,0" VerticalAlignment="Top" Width="90" Foreground="#FFFFFEFE" Click="checkBoxThresholdVoltageVoice_Click"/> |
<Label x:Name="labelThresholdVoltageCrit_Copy2" Content="warning" HorizontalAlignment="Left" Margin="8,-2,0,0" VerticalAlignment="Top" Foreground="White"/> |
</Grid> |
</GroupBox> |
<GroupBox x:Name="groupBox2_Copy1" Header="Voice output" HorizontalAlignment="Left" Height="132" Margin="10,221,0,0" VerticalAlignment="Top" Width="203" BorderThickness="0.5" Foreground="White"> |
<Grid Margin="0,0,-6,-3.96"> |
<CheckBox x:Name="checkBoxSatfixLost" Content="SatFix lost" HorizontalAlignment="Left" Height="16" Margin="10,48,0,0" VerticalAlignment="Top" Width="90" Foreground="#FFFFFEFE" Click="checkBoxSatfixLost_Click"/> |
<CheckBox x:Name="checkBoxMagneticField" Content="Magnetic field level" HorizontalAlignment="Left" Height="16" Margin="10,69,0,0" VerticalAlignment="Top" Width="131" Foreground="#FFFFFEFE" Click="checkBoxMagneticField_Click"/> |
<CheckBox x:Name="checkBoxRClevel" Content="RC level" HorizontalAlignment="Left" Height="16" Margin="10,90,0,0" VerticalAlignment="Top" Width="131" Foreground="#FFFFFEFE" Click="checkBoxRClevel_Click"/> |
<CheckBox x:Name="checkBoxThresholdDistanceVoice" Content="Distance HP" HorizontalAlignment="Left" Height="16" Margin="10,27,0,0" VerticalAlignment="Top" Width="90" Foreground="#FFFFFEFE" Click="checkBoxThresholdDistanceVoice_Click"/> |
<CheckBox x:Name="checkBoxThresholdVoltageVoice" Content="Battery voltage" HorizontalAlignment="Left" Height="16" Margin="10,6,0,0" VerticalAlignment="Top" Width="112" Foreground="#FFFFFEFE" Click="checkBoxThresholdVoltageVoice_Click"/> |
</Grid> |
</GroupBox> |
<GroupBox x:Name="grpBox" Header="Distance HP" HorizontalAlignment="Left" Height="71" Margin="10,118,0,0" VerticalAlignment="Top" Width="203" BorderThickness="0.5" Foreground="White"> |
<Grid Margin="0,0,-6,-3.96"> |
<Slider x:Name="sliderThresholdDistanceWarn" HorizontalAlignment="Left" Height="23" Margin="10,27,0,0" VerticalAlignment="Top" Width="177" ValueChanged="sliderThresholdDistanceWarn_ValueChanged" Maximum="1000" IsSnapToTickEnabled="True" Minimum="10" SmallChange="1" Value="100"/> |
<Label x:Name="labelThresholdDistanceWarn" HorizontalAlignment="Left" Margin="86,3,0,0" VerticalAlignment="Top" Foreground="White" Height="25" Width="45" Content="{Binding Value, ElementName=sliderThresholdDistanceWarn}"> |
<Label.Style> |
<Style TargetType="{x:Type Label}"> |
<Style.Triggers> |
<DataTrigger Binding="{Binding Value, ElementName=sliderThresholdDistanceWarn}"> |
<Setter Property="Content" Value="{Binding Value, ElementName=sliderThresholdDistanceWarn}"/> |
</DataTrigger> |
</Style.Triggers> |
</Style> |
</Label.Style> |
</Label> |
</Grid> |
</GroupBox> |
</Grid> |
</TabItem> |
</TabControl> |
/MKLiveView/v1.0/Source/MainWindow.xaml.cs |
---|
167,6 → 167,30 |
int _iLifeCounter = 0; |
int crcError = 0; |
bool _bSatFix = false; |
Storyboard stbSatFixLostAnim; |
bool _bAnimSatFixActive = false; |
bool _bVoiceSatFixActive = false; |
bool _bVoiceSatFixPlay = false; |
int _iSatsLast = 0; |
int _iSatsJitter = 0; |
bool _bMagneticFieldOK = false; |
Storyboard stbMagneticFieldAnim; |
bool _bAnimMagneticFieldActive = false; |
bool _bVoiceMagneticFieldActive = false; |
bool _bVoiceMagneticFieldPlay = false; |
int _iMagneticFieldLast = 0; |
int _iMagneticFieldJitter = 0; |
bool _bRCLevelOK = false; |
Storyboard stbRCLevelAnim; |
bool _bAnimRCLevelActive = false; |
bool _bVoiceRCLevelActive = false; |
bool _bVoiceRCLevelPlay = false; |
int _iRCLevelLast = 0; |
int _iRCLevelJitter = 0; |
int _iMotors = 4; |
int _LipoCells = 4; |
177,11 → 201,24 |
Storyboard stbVoltageCritAnim; |
bool _bCritAnimVoltActive = false; |
bool _bCritVoiceVoltActive = false; |
bool _bCWarnVoiceVoltActive = false; |
bool _bWarnVoiceVoltActive = false; |
bool _bVoiceVoltPlay = false; |
double _dVoltLast = 0; |
int _iVoltJitter = 0; |
double _dThresholdDistanceWarn = 100; |
Storyboard stbDistanceWarnAnim; |
bool _bAnimDistanceActive = false; |
bool _bVoiceDistanceActive = false; |
bool _bVoiceDistancePlay = false; |
double _dDistanceLast = 0; |
int _iDistanceJitter = 0; |
double _dThresholdDistanceMax = 1000; |
int _iThresholdRC = 160; |
int _iThresholdMagField = 15; |
double _dTopHeight = 36; |
int[] serChan = new int[12] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; |
271,7 → 308,14 |
sliderThresholdVoltageWarn.Value = _dThresholdVoltageWarn; |
sliderThresholdVoltageCrit.Value = _dThresholdVoltageCrit; |
checkBoxThresholdVoltageVoice.IsChecked = _bVoiceVoltPlay; |
checkBoxSatfixLost.IsChecked = _bVoiceSatFixPlay; |
checkBoxMagneticField.IsChecked = _bVoiceMagneticFieldPlay; |
checkBoxThresholdDistanceVoice.IsChecked = _bVoiceDistancePlay; |
sliderThresholdDistanceWarn.Value = _dThresholdDistanceWarn; |
checkBoxRClevel.IsChecked = _bVoiceRCLevelPlay; |
sliderThresholdDistanceWarn.Maximum = _dThresholdDistanceMax; |
cBoxMotors.ItemsSource = iMotors; |
cBoxMotors.SelectedItem = _iMotors; |
507,6 → 551,7 |
_bSaveWinStateFull = (bool)chkBoxSaveFullScreenState.IsChecked; |
} |
#region thresholds |
private void sliderThresholdVoltageWarn_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) |
{ |
if(!_init) |
521,6 → 566,31 |
{ |
_bVoiceVoltPlay = (bool)checkBoxThresholdVoltageVoice.IsChecked; |
} |
private void sliderThresholdDistanceWarn_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) |
{ |
if(!_init) |
_dThresholdDistanceWarn = sliderThresholdDistanceWarn.Value; |
} |
private void checkBoxThresholdDistanceVoice_Click(object sender, RoutedEventArgs e) |
{ |
_bVoiceDistancePlay = (bool)checkBoxThresholdDistanceVoice.IsChecked; |
} |
private void checkBoxSatfixLost_Click(object sender, RoutedEventArgs e) |
{ |
_bVoiceSatFixPlay = (bool)checkBoxSatfixLost.IsChecked; |
} |
private void checkBoxMagneticField_Click(object sender, RoutedEventArgs e) |
{ |
_bVoiceMagneticFieldPlay = (bool)checkBoxMagneticField.IsChecked; |
} |
private void checkBoxRClevel_Click(object sender, RoutedEventArgs e) |
{ |
_bVoiceRCLevelPlay = (bool)checkBoxRClevel.IsChecked; |
} |
#endregion thresholds |
private void buttonSwitchNC_Click(object sender, RoutedEventArgs e) |
{ |
_switchToNC(); |
529,6 → 599,10 |
private void Window_Loaded(object sender, RoutedEventArgs e) |
{ |
stbVoltageCritAnim = TryFindResource("VoltageCritAnim") as Storyboard; |
stbSatFixLostAnim = TryFindResource("SatFixLostAnim") as Storyboard; |
stbMagneticFieldAnim = TryFindResource("MagneticFieldCritAnim") as Storyboard; |
stbDistanceWarnAnim = TryFindResource("DistanceCritAnim") as Storyboard; |
stbRCLevelAnim = TryFindResource("RCCritAnim") as Storyboard; |
_setMotorGridSize(); |
} |
#endregion events |
718,6 → 792,52 |
Dispatcher.Invoke(() => ArtHor.rotateHome = GMapProviders.EmptyProvider.Projection.GetBearing(copter.Position, home.Position)); |
double d = GMapProviders.EmptyProvider.Projection.GetDistance(home.Position, copter.Position); |
Dispatcher.Invoke(() => tbTopDistanceHP.Text = (d * 1000).ToString("0.0 m")); |
if(d*1000 < _dThresholdDistanceWarn) |
{ |
_iDistanceJitter = 0; _bVoiceDistanceActive = false; |
if (stbDistanceWarnAnim != null && _bAnimDistanceActive) |
{ |
Dispatcher.Invoke(() => stbDistanceWarnAnim.Stop()); |
_bAnimDistanceActive = false; |
} |
} |
else |
{ |
//if (d * 1000 == _dDistanceLast) |
//{ |
// if (_iDistanceJitter < 20) |
// { _iDistanceJitter++; } |
//} |
//else |
//{ |
// _iDistanceJitter = 0; |
// _dDistanceLast = d * 1000; |
//} |
if (_iDistanceJitter < 20) |
{ _iDistanceJitter++; } |
if (_iDistanceJitter == 20) |
{ |
if (stbDistanceWarnAnim != null && !_bAnimDistanceActive) |
{ |
Dispatcher.Invoke(() => stbDistanceWarnAnim.Begin()); |
_bAnimDistanceActive = true; |
} |
if (_bVoiceDistancePlay && !_bVoiceDistanceActive) |
{ |
if (File.Exists("Voice\\Distance.mp3")) |
{ |
MediaPlayer.MediaPlayer mp = new MediaPlayer.MediaPlayer(); |
mp.Open("Voice\\Distance.mp3"); |
mp.Play(); |
} |
_bVoiceDistanceActive = true; |
} |
_iDistanceJitter++; |
} |
} |
} |
} |
1245,7 → 1365,7 |
} |
_bCritVoiceVoltActive = false; |
if (_bVoiceVoltPlay && !_bCWarnVoiceVoltActive) |
if (_bVoiceVoltPlay && !_bWarnVoiceVoltActive) |
{ |
if (File.Exists("Voice\\LowBattery.mp3")) |
{ |
1254,7 → 1374,7 |
mp.Open("Voice\\LowBattery.mp3"); |
mp.Play(); |
} |
_bCWarnVoiceVoltActive = true; |
_bWarnVoiceVoltActive = true; |
} |
} |
} |
1268,7 → 1388,7 |
_bCritAnimVoltActive = false; |
} |
_bCritVoiceVoltActive = false; |
_bCWarnVoiceVoltActive = false; |
_bWarnVoiceVoltActive = false; |
_iVoltJitter = 0; |
} |
break; |
1277,27 → 1397,69 |
Dispatcher.Invoke(() => tbTopCurrent.Text = ((double)iAnalogData[index] / (double)10).ToString("0.0 A")); |
break; |
case 10: //heading |
Dispatcher.Invoke((Action)(() => tbHeading.Text = sAnalogData[index] + "°")); |
Dispatcher.Invoke((Action)(() => tbHeading.Text = sAnalogData[index] + "°")); |
Dispatcher.Invoke(() => ArtHor.rotate = iAnalogData[index]); |
break; |
case 12: // SPI error |
Dispatcher.Invoke((Action)(() => tbSPI.Text = sAnalogData[index])); |
Dispatcher.Invoke((Action)(() => tbSPI.Text = sAnalogData[index])); |
break; |
case 14: //i2c error |
Dispatcher.Invoke((Action)(() => tbI2C.Text = sAnalogData[index])); |
Dispatcher.Invoke((Action)(() => tbI2C.Text = sAnalogData[index])); |
break; |
case 20: //Earthmagnet field |
Dispatcher.Invoke((Action)(() => tbMagF.Text = sAnalogData[index] + "%")); |
Dispatcher.Invoke((Action)(() => tbTopEarthMag.Text = sAnalogData[index] + "%")); |
if(iAnalogData[index] > 115 | iAnalogData[index] < 85) |
Dispatcher.Invoke(() => imageEarthMag.Source = new BitmapImage(new Uri("Images/EarthMag_R.png", UriKind.Relative))); |
else |
Dispatcher.Invoke(() => imageEarthMag.Source = new BitmapImage(new Uri("Images/EarthMag.png", UriKind.Relative))); |
Dispatcher.Invoke((Action)(() => tbMagF.Text = sAnalogData[index] + "%")); |
Dispatcher.Invoke((Action)(() => tbTopEarthMag.Text = sAnalogData[index] + "%")); |
if (Math.Abs(100 - iAnalogData[index]) < _iThresholdMagField) |
{ |
Dispatcher.Invoke(() => imageEarthMag.Source = new BitmapImage(new Uri("Images/EarthMag.png", UriKind.Relative))); |
_iMagneticFieldJitter = 0; _bVoiceMagneticFieldActive = false; |
if (stbMagneticFieldAnim != null && _bAnimMagneticFieldActive) |
{ |
Dispatcher.Invoke(() => stbMagneticFieldAnim.Stop()); |
_bAnimMagneticFieldActive = false; |
} |
} |
else |
{ |
Dispatcher.Invoke(() => imageEarthMag.Source = new BitmapImage(new Uri("Images/EarthMag_R.png", UriKind.Relative))); |
if(_iMagneticFieldLast >= Math.Abs(100 - iAnalogData[index])) |
{ |
if (_iMagneticFieldJitter < 20) |
_iMagneticFieldJitter++; |
} |
else |
{ |
_iMagneticFieldJitter = 0; |
_iMagneticFieldLast = Math.Abs(100 - iAnalogData[index]); |
} |
if(_iMagneticFieldJitter == 20) |
{ |
if (stbMagneticFieldAnim != null && !_bAnimMagneticFieldActive) |
{ |
Dispatcher.Invoke(() => stbMagneticFieldAnim.Begin()); |
_bAnimMagneticFieldActive = true; |
} |
if (_bVoiceMagneticFieldPlay && !_bVoiceMagneticFieldActive) |
{ |
if (File.Exists("Voice\\MagneticField.mp3")) |
{ |
MediaPlayer.MediaPlayer mp = new MediaPlayer.MediaPlayer(); |
mp.Open("Voice\\MagneticField.mp3"); |
mp.Play(); |
} |
_bVoiceMagneticFieldActive = true; |
} |
} |
} |
break; |
case 21: //GroundSpeed |
Dispatcher.Invoke((Action)(() => tbSpeed.Text = ((double)iAnalogData[index] / (double)100).ToString("0.00 m/s"))); |
Dispatcher.Invoke((Action)(() => tbTopSpeed.Text = ((double)iAnalogData[index] / (double)100).ToString("0.00 m/s"))); |
break; |
///********** needs testing --> not sure what position this is *************** |
case 28: //Distance East from saved home position -> calculate distance with distance N + height |
dTemp = Math.Pow((double)iAnalogData[index], 2) + Math.Pow((double)iAnalogData[index - 1], 2); |
dTemp = Math.Sqrt(dTemp) / (double)10; //'flat' distance from HP with N/E |
1307,6 → 1469,7 |
// Dispatcher.Invoke((Action)(() => tbTopDistanceHP.Text = dTemp.ToString("0.0 m"))); |
Dispatcher.Invoke((Action)(() => tbHP1.Text = dTemp.ToString("0.0 m"))); |
break; |
case 31: //Sats used |
Dispatcher.Invoke((Action)(() => tbSats.Text = sAnalogData[index])); |
// Dispatcher.Invoke((Action)(() => tbTopSats.Text = sAnalogData[index])); |
1313,45 → 1476,6 |
break; |
} |
} |
//if (adr == 1) //FC |
//{ |
// switch (index) |
// { |
// case 0: //pitch (German: nick) |
// artificialHorizon1.Invoke((Action)(() => artificialHorizon1.pitch_angle = ((double)iAnalogData[index] / (double)10))); |
// lblNCPitch.Invoke((Action)(() => lblNCPitch.Text = ((double)iAnalogData[index] / (double)10).ToString("0.0°"))); |
// break; |
// case 1: //roll |
// artificialHorizon1.Invoke((Action)(() => artificialHorizon1.roll_angle = ((double)iAnalogData[index] / (double)10))); |
// lblNCRoll.Invoke((Action)(() => lblNCRoll.Text = ((double)iAnalogData[index] / (double)10).ToString("0.0°"))); |
// break; |
// case 5: //altitude |
// lblNCAlt.Invoke((Action)(() => lblNCAlt.Text = ((double)iAnalogData[index] / (double)10).ToString("0.0 m"))); |
// break; |
// case 8: //heading |
// lblNCCompass.Invoke((Action)(() => lblNCCompass.Text = sAnalogData[index] + "°")); |
// headingIndicator1.Invoke((Action)(() => headingIndicator1.SetHeadingIndicatorParameters(iAnalogData[index]))); |
// break; |
// case 9: //Voltage |
// lblNCVolt.Invoke((Action)(() => lblNCVolt.Text = ((double)iAnalogData[index] / (double)10).ToString("0.0 V"))); |
// break; |
// case 10: //Receiver quality |
// lblNCRC.Invoke((Action)(() => lblNCRC.Text = sAnalogData[index])); |
// break; |
// case 22: // Current |
// lblNCCur.Invoke((Action)(() => lblNCCur.Text = ((double)iAnalogData[index] / (double)10).ToString("0.0 A"))); |
// break; |
// case 23: //capacity used |
// lblNCCap.Invoke((Action)(() => lblNCCap.Text = (iAnalogData[index]).ToString("0 mAh"))); |
// break; |
// case 27: // SPI error |
// lblNCSPI.Invoke((Action)(() => lblNCSPI.Text = sAnalogData[index])); |
// break; |
// case 28: //i2c error |
// lblNCI2C.Invoke((Action)(() => lblNCI2C.Text = sAnalogData[index])); |
// break; |
// } |
//} |
index++; |
} |
} |
1479,19 → 1603,62 |
iVal += data[5]; |
d = (double)iVal / Math.Pow(10, 7); |
p.Lat = d; |
if (data[50] > 4)//if more than 4 sats in use . otherwise the map would jump and scroll insane at beginning |
{ |
_bSatFix = true; _iSatsJitter = 0; _bVoiceSatFixActive = false; |
if (stbSatFixLostAnim != null && _bAnimSatFixActive) |
{ |
Dispatcher.Invoke(() => stbSatFixLostAnim.Stop()); |
_bAnimSatFixActive = false; |
} |
if (!_bFollowCopter) |
{ |
_setCopterData(p); |
if (!MainMap.ViewArea.Contains(p)) |
Dispatcher.Invoke(() => MainMap.Position = p); |
if (!_bFollowCopter && data[50] > 4) //if more than 4 sats in use . otherwise the map would jump and scroll insane |
{ |
_setCopterData(p); |
if(!MainMap.ViewArea.Contains(p)) |
} |
else |
Dispatcher.Invoke(() => MainMap.Position = p); |
} |
else |
if(data[50] > 4) //if more than 4 sats in use . otherwise the map would jump and scroll insane |
Dispatcher.Invoke(() => MainMap.Position = p); |
{ |
if(_bSatFix) |
{ |
if (data[50] == _iSatsLast) |
{ |
if (_iSatsJitter < 20) _iSatsJitter++; |
} |
else |
{ |
_iSatsJitter = 0; |
_iSatsLast = data[50]; |
} |
if (_iSatsJitter == 20) |
{ |
if (stbSatFixLostAnim != null && !_bAnimSatFixActive) |
{ |
Dispatcher.Invoke(() => stbSatFixLostAnim.Begin()); |
_bAnimSatFixActive = true; |
} |
if (_bVoiceSatFixPlay && !_bVoiceSatFixActive) |
{ |
if (File.Exists("Voice\\CriticalBattery.mp3")) |
{ |
MediaPlayer.MediaPlayer mp = new MediaPlayer.MediaPlayer(); |
mp.Open("Voice\\CriticalBattery.mp3"); |
mp.Play(); |
} |
_bVoiceSatFixActive = true; |
} |
_bSatFix = false; |
} |
} |
} |
// lblNCGPSLat.Invoke((Action)(() => lblNCGPSLat.Text = d.ToString("0.######°"))); //GPS-Position: Latitude in decimal degree |
//lblNCGPSLat.Invoke((Action)(() => lblNCGPSLat.Text = _convertDegree(d))); //GPS-Position: Latitude in minutes, seconds |
1532,7 → 1699,40 |
Dispatcher.Invoke((Action)(() => tbRCQ.Text = data[66].ToString())); |
Dispatcher.Invoke((Action)(() => tbTopRC.Text = data[66].ToString())); |
if(data[66] > _iThresholdRC) |
{ |
_iRCLevelJitter = 0; _bVoiceRCLevelActive = false; |
if (stbRCLevelAnim != null && _bAnimRCLevelActive) |
{ |
Dispatcher.Invoke(() => stbRCLevelAnim.Stop()); |
_bAnimRCLevelActive = false; |
} |
} |
else |
{ |
if (_iRCLevelJitter < 20) _iRCLevelJitter++; |
if (_iRCLevelJitter == 20) |
{ |
if (stbRCLevelAnim != null && !_bAnimRCLevelActive) |
{ |
Dispatcher.Invoke(() => stbRCLevelAnim.Begin()); |
_bAnimRCLevelActive = true; |
} |
if (_bVoiceRCLevelPlay && !_bVoiceRCLevelActive) |
{ |
if (File.Exists("Voice\\RCLevel.mp3")) |
{ |
MediaPlayer.MediaPlayer mp = new MediaPlayer.MediaPlayer(); |
mp.Open("Voice\\RCLevel.mp3"); |
mp.Play(); |
} |
_bVoiceRCLevelActive = true; |
} |
_iRCLevelJitter++; |
} |
} |
//--------------- NC Error ------------------------ |
Dispatcher.Invoke((Action)(() => tbNCErr.Text = data[69].ToString())); //NC Errornumber |
if (data[69] > 0) |
2135,11 → 2335,28 |
if(sVal != "") _dThresholdVoltageWarn = Convert.ToDouble(sVal); |
sVal = ini.IniReadValue("threshold", "VoltageCritical"); |
if(sVal != "") _dThresholdVoltageCrit = Convert.ToDouble(sVal); |
sVal = ini.IniReadValue("threshold", "VoiceEnable"); |
sVal = ini.IniReadValue("threshold", "VoiceVoltageEnable"); |
if(sVal != "") _bVoiceVoltPlay = Convert.ToBoolean(sVal); |
sVal = ini.IniReadValue("threshold", "VoiceSatFixEnable"); |
if(sVal != "") _bVoiceSatFixPlay = Convert.ToBoolean(sVal); |
sVal = ini.IniReadValue("threshold", "VoiceMagFieldEnable"); |
if(sVal != "") _bVoiceMagneticFieldPlay = Convert.ToBoolean(sVal); |
sVal = ini.IniReadValue("threshold", "DistanceWarning"); |
if(sVal != "") _dThresholdDistanceWarn = Convert.ToDouble(sVal); |
sVal = ini.IniReadValue("threshold", "VoiceDistanceWarnEnable"); |
if(sVal != "") _bVoiceDistancePlay = Convert.ToBoolean(sVal); |
sVal = ini.IniReadValue("threshold", "VoiceRCLevelWarnEnable"); |
if(sVal != "") _bVoiceRCLevelPlay = Convert.ToBoolean(sVal); |
sVal = ini.IniReadValue("threshold", "MaxDistance"); |
if(sVal != "") _dThresholdDistanceMax = Convert.ToDouble(sVal); |
sVal = ini.IniReadValue("threshold", "RCThreshold"); |
if(sVal != "") _iThresholdRC = Convert.ToInt32(sVal); |
sVal = ini.IniReadValue("threshold", "MagFieldThreshold"); |
if(sVal != "") _iThresholdMagField = Convert.ToInt32(sVal); |
} |
/// <summary> |
/// save settings to ini-file |
/// </summary> |
2196,8 → 2413,15 |
ini.IniWriteValue("threshold", "VoltageWarning", _dThresholdVoltageWarn.ToString()); |
ini.IniWriteValue("threshold", "VoltageCritical", _dThresholdVoltageCrit.ToString()); |
ini.IniWriteValue("threshold", "VoiceEnable", _bVoiceVoltPlay.ToString()); |
ini.IniWriteValue("threshold", "VoiceVoltageEnable", _bVoiceVoltPlay.ToString()); |
ini.IniWriteValue("threshold", "VoiceSatFixEnable", _bVoiceSatFixPlay.ToString()); |
ini.IniWriteValue("threshold", "VoiceMagFieldEnable", _bVoiceMagneticFieldPlay.ToString()); |
ini.IniWriteValue("threshold", "VoiceDistanceWarnEnable", _bVoiceDistancePlay.ToString()); |
ini.IniWriteValue("threshold", "VoiceRCLevelWarnEnable", _bVoiceRCLevelPlay.ToString()); |
ini.IniWriteValue("threshold", "DistanceWarning", _dThresholdDistanceWarn.ToString()); |
ini.IniWriteValue("threshold", "MaxDistance", _dThresholdDistanceMax.ToString()); |
ini.IniWriteValue("threshold", "RCThreshold", _iThresholdRC.ToString()); |
ini.IniWriteValue("threshold", "MagFieldThreshold", _iThresholdMagField.ToString()); |
} |
#endregion functions |