Rev 2405 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2405 | Rev 2408 | ||
---|---|---|---|
Line 767... | Line 767... | ||
767 | { |
767 | { |
768 | if (cWPBound != null && cWPBound.Tag != null) |
768 | if (cWPBound != null && cWPBound.Tag != null) |
769 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
769 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
Line 770... | Line 770... | ||
770 | 770 | ||
- | 771 | createCircle(home.Position, dWPMaxRange); |
|
- | 772 | Dispatcher.Invoke(() => |
|
- | 773 | { |
|
- | 774 | if (comboBoxWPMaxRangeColor.SelectionBoxItem != null) |
|
- | 775 | { |
|
- | 776 | string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString(); |
|
- | 777 | cWPBound.setColor(s); |
|
- | 778 | } |
|
771 | createCircle(home.Position, dWPMaxRange); |
779 | }); |
Line 772... | Line 780... | ||
772 | } |
780 | } |
773 | 781 | ||
774 | } |
782 | } |
Line 2026... | Line 2034... | ||
2026 | { |
2034 | { |
2027 | if (cWPBound != null && cWPBound.Tag != null) |
2035 | if (cWPBound != null && cWPBound.Tag != null) |
2028 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
2036 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
Line 2029... | Line 2037... | ||
2029 | 2037 | ||
- | 2038 | createCircle(home.Position, dWPMaxRange); |
|
- | 2039 | Dispatcher.Invoke(() => |
|
- | 2040 | { |
|
- | 2041 | if (comboBoxWPMaxRangeColor.SelectionBoxItem != null) |
|
- | 2042 | { |
|
- | 2043 | string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString(); |
|
- | 2044 | cWPBound.setColor(s); |
|
- | 2045 | } |
|
2030 | createCircle(home.Position, dWPMaxRange); |
2046 | }); |
2031 | } |
2047 | } |
2032 | Dispatcher.Invoke((Action)(() => tbWPMaxRange.Text = data[70].ToString() + " m")); |
2048 | Dispatcher.Invoke((Action)(() => tbWPMaxRange.Text = data[70].ToString() + " m")); |
2033 | } |
2049 | } |
2034 | //Target hold time |
2050 | //Target hold time |
Line 2926... | Line 2942... | ||
2926 | if(sVal != "") comboBoxLandingColor.SelectedIndex = Convert.ToInt32(sVal); |
2942 | if(sVal != "") comboBoxLandingColor.SelectedIndex = Convert.ToInt32(sVal); |
2927 | sVal = ini.IniReadValue("waypoints", "routecolor"); |
2943 | sVal = ini.IniReadValue("waypoints", "routecolor"); |
2928 | if(sVal != "") comboBoxRouteColor.SelectedIndex = Convert.ToInt32(sVal); |
2944 | if(sVal != "") comboBoxRouteColor.SelectedIndex = Convert.ToInt32(sVal); |
2929 | sVal = ini.IniReadValue("waypoints", "showWPRoute"); |
2945 | sVal = ini.IniReadValue("waypoints", "showWPRoute"); |
2930 | if(sVal != "") _bShowWPRoute = Convert.ToBoolean(sVal); |
2946 | if(sVal != "") _bShowWPRoute = Convert.ToBoolean(sVal); |
- | 2947 | sVal = ini.IniReadValue("waypoints", "showWPMaxRange"); |
|
- | 2948 | if(sVal != "") checkBoxShowWPMaxRange.IsChecked = Convert.ToBoolean(sVal); |
|
- | 2949 | sVal = ini.IniReadValue("waypoints", "WPMaxRangecolor"); |
|
- | 2950 | if(sVal != "") comboBoxWPMaxRangeColor.SelectedIndex = Convert.ToInt32(sVal); |
|
Line 2931... | Line 2951... | ||
2931 | 2951 | ||
2932 | for (int i = 0; i < 12; i++) |
2952 | for (int i = 0; i < 12; i++) |
2933 | { |
2953 | { |
2934 | sVal = ini.IniReadValue("serial", "ch" + i.ToString() + "Val"); |
2954 | sVal = ini.IniReadValue("serial", "ch" + i.ToString() + "Val"); |
Line 3031... | Line 3051... | ||
3031 | ini.IniWriteValue("waypoints", "coptercolor", comboBoxCopterColor.SelectedIndex.ToString()); |
3051 | ini.IniWriteValue("waypoints", "coptercolor", comboBoxCopterColor.SelectedIndex.ToString()); |
3032 | ini.IniWriteValue("waypoints", "copterheadingcolor", comboBoxCopterHeadingColor.SelectedIndex.ToString()); |
3052 | ini.IniWriteValue("waypoints", "copterheadingcolor", comboBoxCopterHeadingColor.SelectedIndex.ToString()); |
3033 | ini.IniWriteValue("waypoints", "landingcolor", comboBoxLandingColor.SelectedIndex.ToString()); |
3053 | ini.IniWriteValue("waypoints", "landingcolor", comboBoxLandingColor.SelectedIndex.ToString()); |
3034 | ini.IniWriteValue("waypoints", "routecolor", comboBoxRouteColor.SelectedIndex.ToString()); |
3054 | ini.IniWriteValue("waypoints", "routecolor", comboBoxRouteColor.SelectedIndex.ToString()); |
3035 | ini.IniWriteValue("waypoints", "showWPRoute", _bShowWPRoute.ToString()); |
3055 | ini.IniWriteValue("waypoints", "showWPRoute", _bShowWPRoute.ToString()); |
- | 3056 | ini.IniWriteValue("waypoints", "showWPMaxRange", ((bool)checkBoxShowWPMaxRange.IsChecked).ToString()); |
|
- | 3057 | ini.IniWriteValue("waypoints", "WPMaxRangecolor", comboBoxWPMaxRangeColor.SelectedIndex.ToString()); |
|
Line 3036... | Line 3058... | ||
3036 | 3058 | ||
3037 | for (int i = 0; i < 12; i++) |
3059 | for (int i = 0; i < 12; i++) |
3038 | { |
3060 | { |
3039 | ini.IniWriteValue("serial", "ch" + i.ToString() + "Val", serChan[i].ToString()); |
3061 | ini.IniWriteValue("serial", "ch" + i.ToString() + "Val", serChan[i].ToString()); |
Line 3734... | Line 3756... | ||
3734 | if (_bShowWPRoute) |
3756 | if (_bShowWPRoute) |
3735 | MainMap.Markers.Add(mRouteWP); |
3757 | MainMap.Markers.Add(mRouteWP); |
3736 | } |
3758 | } |
3737 | }); |
3759 | }); |
3738 | } |
3760 | } |
- | 3761 | private void comboBoxWPMaxRangeColor_DropDownClosed(object sender, EventArgs e) |
|
- | 3762 | { |
|
- | 3763 | Dispatcher.Invoke(() => |
|
- | 3764 | { |
|
- | 3765 | if (comboBoxWPMaxRangeColor.SelectionBoxItem != null) |
|
- | 3766 | { |
|
- | 3767 | if (home != null && checkBoxShowWPMaxRange.IsChecked == true && dWPMaxRange > 0) |
|
- | 3768 | { |
|
- | 3769 | if (cWPBound != null && cWPBound.Tag != null) |
|
- | 3770 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
|
- | 3771 | ||
- | 3772 | createCircle(home.Position, dWPMaxRange); |
|
- | 3773 | string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString(); |
|
- | 3774 | cWPBound.setColor(s); |
|
- | 3775 | ||
- | 3776 | } |
|
- | 3777 | } |
|
- | 3778 | }); |
|
- | 3779 | ||
- | 3780 | } |
|
3739 | private void checkBoxShowWPRoute_Click(object sender, RoutedEventArgs e) |
3781 | private void checkBoxShowWPRoute_Click(object sender, RoutedEventArgs e) |
3740 | { |
3782 | { |
3741 | _bShowWPRoute = (bool)checkBoxShowWPRoute.IsChecked; |
3783 | _bShowWPRoute = (bool)checkBoxShowWPRoute.IsChecked; |
3742 | if (_bShowWPRoute) |
3784 | if (_bShowWPRoute) |
3743 | { |
3785 | { |
Line 4315... | Line 4357... | ||
4315 | if (home != null && checkBoxShowWPMaxRange.IsChecked == true && dWPMaxRange > 0) |
4357 | if (home != null && checkBoxShowWPMaxRange.IsChecked == true && dWPMaxRange > 0) |
4316 | { |
4358 | { |
4317 | if (cWPBound != null && cWPBound.Tag != null) |
4359 | if (cWPBound != null && cWPBound.Tag != null) |
4318 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
4360 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
Line 4319... | Line 4361... | ||
4319 | 4361 | ||
- | 4362 | createCircle(home.Position, dWPMaxRange); |
|
- | 4363 | string s = comboBoxWPMaxRangeColor.SelectionBoxItem.ToString(); |
|
- | 4364 | cWPBound.setColor(s); |
|
4320 | createCircle(home.Position, dWPMaxRange); |
4365 | |
- | 4366 | } |
|
4321 | } |
4367 | |
4322 | if (checkBoxShowWPMaxRange.IsChecked == false && (cWPBound != null && cWPBound.Tag != null)) |
4368 | if (checkBoxShowWPMaxRange.IsChecked == false && (cWPBound != null && cWPBound.Tag != null)) |
4323 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
4369 | MainMap.Markers.Remove(cWPBound.Tag as GMapMarker); |
4324 | } |
4370 | } |
4325 | #endregion WP |
4371 | #endregion WP |
Line 4389... | Line 4435... | ||
4389 | { |
4435 | { |
4390 | myXmlTextWriter.Close(); |
4436 | myXmlTextWriter.Close(); |
4391 | } |
4437 | } |
4392 | } |
4438 | } |
4393 | } |
4439 | } |
4394 | - | ||
4395 | - | ||
4396 | private void btnLoadGPXLog_Click(object sender, RoutedEventArgs e) |
4440 | private void btnLoadGPXLog_Click(object sender, RoutedEventArgs e) |
4397 | { |
4441 | { |
4398 | _loadGPXLog(); |
4442 | _loadGPXLog(); |
4399 | } |
4443 | } |
4400 | private void btnClearRoute_Click(object sender, RoutedEventArgs e) |
4444 | private void btnClearRoute_Click(object sender, RoutedEventArgs e) |