Subversion Repositories Projects

Compare Revisions

Regard whitespace Rev 2334 → Rev 2335

/MKLiveView/v1.0/Source/MainWindow.xaml
664,7 → 664,7
</TabItem>
</TabControl>
</Grid>
<Grid x:Name="GridSettings" Background="#7B000000" HorizontalAlignment="Left" Width="233" Margin="23,36,0,0" Visibility="Collapsed">
<Grid x:Name="GridSettings" Background="#7B000000" HorizontalAlignment="Left" Width="233" Margin="23,36,0,0">
<TabControl x:Name="tabControlSettings" HorizontalAlignment="Left" Width="229" Background="{x:Null}" Margin="2,0,0,0">
<TabItem Header="General" Margin="0,0,-0.237,0">
<Grid x:Name="TabGridGeneral">
970,7 → 970,7
<Button x:Name="btnOSDEnter" Content="" HorizontalAlignment="Left" Height="34" Margin="87,90,0,0" VerticalAlignment="Top" Width="52" Click="btnOSDEnter_Click"/>
<Button x:Name="btnOSDLeave" Content="" HorizontalAlignment="Left" Height="34" Margin="144,90,0,0" VerticalAlignment="Top" Width="52" Click="btnOSDLeave_Click"/>
</Grid>
<Grid x:Name="GridWP" Margin="23,36,25,0" Background="#7F000000" Height="500" VerticalAlignment="Top">
<Grid x:Name="GridWP" Margin="23,36,25,0" Background="#7F000000" Height="500" VerticalAlignment="Top" Visibility="Collapsed">
<Label x:Name="label4" Content="points" HorizontalAlignment="Right" Margin="0,376,41,0" VerticalAlignment="Top" Width="53" Foreground="White" Height="26" HorizontalContentAlignment="Right"/>
<Label x:Name="lblWPCount" Content="##" HorizontalAlignment="Right" Margin="0,382,5,0" VerticalAlignment="Top" Width="38" Foreground="White" HorizontalContentAlignment="Right" Padding="0" Height="16"/>
<Label x:Name="label4_Copy" Content="WP Index" HorizontalAlignment="Left" Margin="94,194,0,0" VerticalAlignment="Top" Width="80" Foreground="White" Visibility="Hidden"/>
988,7 → 988,7
</Style>
</Rectangle.Style>
</Rectangle>
<Button x:Name="btnGetWPList" Content="" HorizontalAlignment="Left" Height="39" Margin="103,0,0,61" VerticalAlignment="Bottom" Width="94" Click="btnGetWP_Click" ToolTip="Download WP-list from copter" BorderBrush="#FFBDBDBD" Style="{DynamicResource ButtonWithoutEffectStyle}">
<Button x:Name="btnGetWPList" Content="" HorizontalAlignment="Left" Height="36" Margin="104,0,0,62" VerticalAlignment="Bottom" Width="92" Click="btnGetWP_Click" ToolTip="Download WP-list from copter" BorderBrush="#FFBDBDBD" Style="{DynamicResource ButtonWithoutEffectStyle}">
<Button.Background>
<ImageBrush ImageSource="Images/FromCopterToPc.png" Stretch="Uniform"/>
</Button.Background>
1004,7 → 1004,7
</Style>
</Rectangle.Style>
</Rectangle>
<Button x:Name="btnSendWPList" Content="" HorizontalAlignment="Left" Height="39" Margin="4,0,0,61" VerticalAlignment="Bottom" Width="94" ToolTip="Upload WP-list to copter" BorderBrush="#FFBDBDBD" Click="btnSendWPList_Click" Style="{DynamicResource ButtonWithoutEffectStyle}">
<Button x:Name="btnSendWPList" Content="" HorizontalAlignment="Left" Height="36" Margin="5,0,0,62" VerticalAlignment="Bottom" Width="92" ToolTip="Upload WP-list to copter" BorderBrush="#FFBDBDBD" Click="btnSendWPList_Click" Style="{DynamicResource ButtonWithoutEffectStyle}">
<Button.Background>
<ImageBrush ImageSource="Images/FromPcToCopter.png" Stretch="Uniform"/>
</Button.Background>
1020,7 → 1020,7
</Style>
</Rectangle.Style>
</Rectangle>
<Button x:Name="btnLoadWPLFile" Content="" HorizontalAlignment="Left" Height="39" Margin="4,0,0,0" VerticalAlignment="Bottom" Width="94" ToolTip="load wp-list from file" BorderBrush="#FFBDBDBD" HorizontalContentAlignment="Center" Click="btnLoadWPLFile_Click" Style="{DynamicResource ButtonWithoutEffectStyle}">
<Button x:Name="btnLoadWPLFile" Content="" HorizontalAlignment="Left" Height="37" Margin="4,0,0,1" VerticalAlignment="Bottom" Width="94" ToolTip="load wp-list from file" BorderBrush="#FFBDBDBD" HorizontalContentAlignment="Center" Click="btnLoadWPLFile_Click" Style="{DynamicResource ButtonWithoutEffectStyle}">
<Button.Background>
<ImageBrush ImageSource="Images/LoadFile.png" Stretch="Uniform"/>
</Button.Background>
1028,9 → 1028,26
<Label x:Name="label4_Copy5" Content="receive from copter" HorizontalAlignment="Left" Margin="98,0,0,98" VerticalAlignment="Bottom" Width="116" Foreground="White"/>
<Label x:Name="label4_Copy6" Content="send to copter" HorizontalAlignment="Left" Margin="1,0,0,98" VerticalAlignment="Bottom" Width="86" Foreground="White"/>
<Label x:Name="label4_Copy7" Content="load from file" HorizontalAlignment="Left" Margin="0,0,0,36" VerticalAlignment="Bottom" Width="86" Foreground="White"/>
<Rectangle HorizontalAlignment="Left" Width="48" Stroke="#FFE4E4E4" StrokeThickness="0.5" Margin="149,86,0,0">
<Rectangle.Style>
<Style TargetType="{x:Type Rectangle}">
<Style.Triggers>
<DataTrigger Binding="{Binding IsMouseOver, ElementName=btnClearWPList}" Value="True">
<Setter Property="Fill" Value="{DynamicResource PressedItemBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Rectangle.Style>
</Rectangle>
<Button x:Name="btnClearWPList" Content="" HorizontalAlignment="Left" Height="36" Margin="149,0,0,2" VerticalAlignment="Bottom" Width="48" ToolTip="Download WP-list from copter" BorderBrush="#FFBDBDBD" Style="{DynamicResource ButtonWithoutEffectStyle}" Click="btnClearWPList_Click">
<Button.Background>
<ImageBrush ImageSource="Images/DeleteList.png" Stretch="Uniform"/>
</Button.Background>
</Button>
<Label x:Name="label4_Copy11" Content="clear list" HorizontalAlignment="Left" Margin="145,0,0,36" VerticalAlignment="Bottom" Width="56" Foreground="White"/>
</Grid>
</Border>
<DataGrid x:Name="dgvWP" Margin="10,5,10,143" Background="{x:Null}" ItemsSource="{Binding dtWaypoints1}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="14" HorizontalGridLinesBrush="#FF688CAF" VerticalGridLinesBrush="#FF688CAF" HeadersVisibility="Column" BorderBrush="{x:Null}" Padding="0" AutoGenerateColumns="False">
<DataGrid x:Name="dgvWP" Margin="10,5,10,143" Background="{x:Null}" ItemsSource="{Binding}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="14" HorizontalGridLinesBrush="#FF688CAF" VerticalGridLinesBrush="#FF688CAF" HeadersVisibility="Column" BorderBrush="{x:Null}" Padding="0" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Index" Binding="{Binding Path=Index}"/>
<DataGridTextColumn Header="Type" Binding="{Binding Path=Type, Converter={StaticResource wpConvert}, ConverterParameter= Type}"/>
/MKLiveView/v1.0/Source/MainWindow.xaml.cs
697,7 → 697,19
{
MainMap.Markers.Remove(home);
}
void _clearMapMarkers(Type markerType)
{
for (int k = 0; k < MainMap.Markers.Count;)
{
GMapMarker p = MainMap.Markers[k];
if (p.GetType() == markerType | p.Shape.GetType() == markerType)
MainMap.Markers.Remove(p);
else
k++;
}
 
}
 
// access mode
private void comboBoxMode_DropDownClosed(object sender, EventArgs e)
{
1655,7 → 1667,7
}
if (_bVoiceSatFixPlay && !_bVoiceSatFixActive)
{
Thread th = new Thread(() => _mediaPlayer("Voice\\CriticalBattery.mp3"));
Thread th = new Thread(() => _mediaPlayer("Voice\\SatFixLost.mp3"));
th.Start();
_bVoiceSatFixActive = true;
}
1839,6 → 1851,7
});
Dispatcher.Invoke(() => dgvWP.Items.Refresh());
Dispatcher.Invoke(() => _iWPIndex = data[1]);
if ((int)dr[1] == 0)
wpList.Add(new PointLatLng((double)dr[3], (double)dr[4]));
if (data[1] == data[0])
{
2086,11 → 2099,15
}
void _getWP()
{
int iTimeout = 0;
_bGetWPCount = true;
_getpWP(1); //get the itemscount of wp
while (_bGetWPCount)
Thread.Sleep(100);
if (_iWPCount > 0)
while (_bGetWPCount & iTimeout < _iWPTimeout * 5)
{
Thread.Sleep(10);
iTimeout++;
}
if (_iWPCount > 0 & !_bGetWPCount)
_getWPList();
}
void _getWPList()
2110,6 → 2127,7
}
void _sendWPList()
{
int iTimeout = 0;
if (serialPortCtrl.Port.IsOpen)
{
byte[] bData = new byte[30];
2120,9 → 2138,14
serialStream.Write(bytes, 0, bytes.Length);
 
_iWPCount = -1;
while (_iWPCount == -1)
while (_iWPCount == -1 & iTimeout < _iWPTimeout * 5)
{
Thread.Sleep(10);
iTimeout++;
}
Dispatcher.Invoke(() => lblWPCount.Content = _iWPCount.ToString());
if (_iWPCount > -1)
{
 
int iVal;
double dVal;
2188,12 → 2211,24
serialStream.Write(bytes, 0, bytes.Length);
 
_iWPCount = -1;
while (_iWPCount == -1)
iTimeout = 0;
while (_iWPCount == -1 & iTimeout < _iWPTimeout * 5)
{
Thread.Sleep(10);
iTimeout++;
}
if (_iWPCount == -1)
{
Log(LogMsgType.Error, "Timeout while sending list!");
break;
}
Dispatcher.Invoke(() => lblWPCount.Content = _iWPCount.ToString());
}
}
else
Log(LogMsgType.Error, "Timeout while sending list!");
}
else
Log(LogMsgType.Error, "NOT CONNECTED!");
 
}
2977,7 → 3012,20
{
_readWPLFile();
}
private void btnClearWPList_Click(object sender, RoutedEventArgs e)
{
_clearMapMarkers(typeof(CustomMarkerWP));
wpList.Clear();
if (mRouteWP != null)
MainMap.Markers.Remove(mRouteWP);
dtWaypoints.Rows.Clear();
Dispatcher.Invoke(() => dgvWP.Items.Refresh());
Dispatcher.Invoke(() => lblWPIndex.Content = 0);
Dispatcher.Invoke(() => lblWPCount.Content = 0);
Dispatcher.Invoke(() => lblWPRouteDistance.Content = "0 m");
}
#endregion WP
 
#region GPX
private void checkBoxGPXLog_Click(object sender, RoutedEventArgs e)
{
3056,18 → 3104,7
{
_clearMapMarkers(typeof(GMapRoute));
}
void _clearMapMarkers(Type markerType)
{
for (int k = 0; k < MainMap.Markers.Count;)
{
GMapMarker p = MainMap.Markers[k];
if (p.GetType() == markerType | p.Shape.GetType() == markerType)
MainMap.Markers.Remove(p);
else
k++;
}
 
}
void _loadGPXLog()
{