Subversion Repositories Projects

Compare Revisions

Ignore whitespace Rev 2418 → Rev 2419

/MKLiveView/v1.0/Source/MainWindow.xaml
840,7 → 840,7
</TabItem>
</TabControl>
</Grid>
<Grid x:Name="GridSettings" Background="#7B000000" HorizontalAlignment="Left" Width="233" Margin="23,36,0,0">
<Grid x:Name="GridSettings" Background="#7B000000" HorizontalAlignment="Left" Width="233" Margin="23,36,0,0" Visibility="Collapsed">
<TabControl x:Name="tabControlSettings" HorizontalAlignment="Left" Width="229" Background="{x:Null}" Margin="4,0,0,0">
<TabItem Header="General" Margin="0,0,5.849,0">
<Grid x:Name="TabGridGeneral">
911,7 → 911,7
</Style>
</Label.Style>
</Label>
<Slider x:Name="UIScaleOSDSlider" HorizontalAlignment="Left" Height="16" Margin="9,148,0,0" VerticalAlignment="Top" Width="207" Value="1" Maximum="2" Minimum="0.5" LargeChange="0.01" SmallChange="0.001"/>
<Slider x:Name="UIScaleOSDSlider" HorizontalAlignment="Left" Height="16" Margin="9,148,0,0" VerticalAlignment="Top" Width="207" Value="1" Maximum="2" Minimum="0.5" LargeChange="0.01" SmallChange="0.001" ValueChanged="UIScaleOSDSlider_ValueChanged"/>
<Label x:Name="label_Copy10" Content="OSD scale" HorizontalAlignment="Left" Margin="14,131,0,0" VerticalAlignment="Top" Foreground="White" Padding="0" Width="95"/>
<Label x:Name="labelOSDScale" HorizontalAlignment="Left" Margin="95,131,0,0" VerticalAlignment="Top" Foreground="White" Padding="0" Width="42" Content="{Binding Value, ElementName=UIScaleOSDSlider}">
<Label.Style>
1228,7 → 1228,7
</LinearGradientBrush>
</Label.Background>
</Label>
<Grid x:Name="GridWP" Margin="23,36,25,0" Background="#7F000000" Height="526" VerticalAlignment="Top" Visibility="Collapsed">
<Grid x:Name="GridWP" Margin="23,36,25,0" Background="#7F000000" Height="526" VerticalAlignment="Top">
<Label x:Name="label4" Content="points" HorizontalAlignment="Right" Margin="0,480,51,0" VerticalAlignment="Top" Width="53" Foreground="White" Height="19" HorizontalContentAlignment="Right" Padding="0" VerticalContentAlignment="Center" FontSize="13" Visibility="Hidden"/>
<Label x:Name="lblWPCount" Content="##" HorizontalAlignment="Right" Margin="0,482,19,0" VerticalAlignment="Top" Width="26" Foreground="White" HorizontalContentAlignment="Right" Padding="0" Height="16" FontSize="13" Visibility="Hidden"/>
<Label x:Name="label4_Copy" Content="WP Index" HorizontalAlignment="Left" Margin="94,194,0,0" VerticalAlignment="Top" Width="80" Foreground="White" Visibility="Hidden"/>
/MKLiveView/v1.0/Source/MainWindow.xaml.cs
813,7 → 813,7
else
k++;
}
 
_WPisMouseCaptured = false;
}
 
GMapMarker _findWPMarker(string name)
1060,16 → 1060,19
int iZoom;
private void MainMap_StylusDown(object sender, StylusDownEventArgs e)
{
var id = e.StylusDevice.Id;
e.StylusDevice.Capture(MainMap);
if (iFirstStylusID == -1)
if (!_WPisMouseCaptured)
{
iFirstStylusID = id;
}
else
{
var id = e.StylusDevice.Id;
e.StylusDevice.Capture(MainMap);
if (iFirstStylusID == -1)
{
iFirstStylusID = id;
}
else
{
 
MainMap.CanDragMap = false;
MainMap.CanDragMap = false;
}
}
}
private void MainMap_StylusUp(object sender, StylusEventArgs e)
2400,6 → 2403,12
iTimeout++;
}
}
Dispatcher.Invoke(() =>
{
// MainMap.ZoomAndCenterMarkers(null);
MainMap.Position = new PointLatLng((double)dtWaypoints.Rows[0][3], (double)dtWaypoints.Rows[0][4]);
MainMap.Zoom = 19;
});
}
/// <summary>
/// Wrapper for _clearCopterWPList()
2757,6 → 2766,17
if (GridWP != null)
GridWP.Margin = new Thickness(GridWP.Margin.Left, 36 * UIScaleTopSlider.Value, GridWP.Margin.Right, GridWP.Margin.Bottom);
}
private void UIScaleOSDSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
if (!_init)
{
if (WPStatus != null && (WPStatus.Visibility == Visibility.Visible))
GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value + 36, GridOSD.Margin.Right, GridOSD.Margin.Bottom);
else
GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value, GridOSD.Margin.Right, GridOSD.Margin.Bottom);
}
}
 
/// <summary>
/// restore the saved scalings for the fullscreen/normal window mode
/// </summary>
3512,9 → 3532,12
Dispatcher.Invoke(() => lblWPIndex.Content = k.ToString());
Dispatcher.Invoke(() => lblWPCount.Content = k.ToString());
Dispatcher.Invoke(() => dgvWP.Items.Refresh());
Thread.Sleep(10);
Thread.Sleep(1);
}
_routeUpdate();
Dispatcher.Invoke(() => MainMap.Position = new PointLatLng((double)dtWaypoints.Rows[0][3], (double)dtWaypoints.Rows[0][4]));
Dispatcher.Invoke(() => MainMap.Zoom = 19);
// Dispatcher.Invoke(() => MainMap.ZoomAndCenterMarkers(null));
Dispatcher.Invoke(() => _routeUpdate());
}
}
}
3624,6 → 3647,7
Dispatcher.Invoke(()=>
{
wpMarker.Shape = new CustomMarkerWP(this, wpMarker, name, type);
wpMarker.Tag = name;
wpMarker.Offset = new System.Windows.Point(-11.5, -11.5);
wpMarker.ZIndex = 100;
_setMarkerColor(wpMarker, type);
3630,9 → 3654,50
MainMap.Markers.Add(wpMarker);
if (type == 0 || type == 3)
wpList.Add(p);
((CustomMarkerWP)wpMarker.Shape).positionChanged += _updateDTWPPos;
((CustomMarkerWP)wpMarker.Shape).newPosition += _updateDTWPPosFin;
((CustomMarkerWP)wpMarker.Shape).mouseCaptured += _WPMouseCatured;
});
return wpMarker;
}
bool _WPisMouseCaptured = false;
void _WPMouseCatured(bool isCaptured)
{
_WPisMouseCaptured = isCaptured;
MainMap.CanDragMap = !isCaptured;
}
void _updateDTWPPos(CustomMarkerWP wp)
{
string sIndex = wp.WPText.Substring(1, wp.WPText.Length - 1);
int index = Convert.ToInt16(sIndex) -1;
GMapMarker p = ((GMapMarker)wp.DataContext);
if (p != null && index < dtWaypoints.Rows.Count)
{
//dtWaypoints.Rows[index][3] = p.Position.Lat;
//dtWaypoints.Rows[index][4] = p.Position.Lng;
//Dispatcher.Invoke(() => dgvWP.Items.Refresh());
if(wp.WPType == 0 | wp.WPType == 3)
{
wpList[index] = p.Position;
MainMap.Markers.Remove(mRouteWP);
_routeUpdate();
}
}
}
void _updateDTWPPosFin(CustomMarkerWP wp)
{
string sIndex = wp.WPText.Substring(1, wp.WPText.Length - 1);
int index = Convert.ToInt16(sIndex) -1;
GMapMarker p = ((GMapMarker)wp.DataContext);
if (p != null && index < dtWaypoints.Rows.Count)
{
dtWaypoints.Rows[index][3] = p.Position.Lat;
dtWaypoints.Rows[index][4] = p.Position.Lng;
Dispatcher.Invoke(() => dgvWP.Items.Refresh());
}
 
}
 
void _setMarkerColor(GMapMarker wpMarker,int iType)
{
if(wpMarker != null)
4360,9 → 4425,11
MainMap.Markers.Remove(cWPBound.Tag as GMapMarker);
 
createCircle(home.Position, dWPMaxRange);
string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString();
cWPBound.setColor(s);
 
if (comboBoxWPMaxRangeColor.SelectionBoxItem != null)
{
string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString();
cWPBound.setColor(s);
}
}
 
if (checkBoxShowWPMaxRange.IsChecked == false && (cWPBound != null && cWPBound.Tag != null))