Subversion Repositories Projects

Rev

Rev 2363 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2363 Rev 2366
Line 1723... Line 1723...
1723
                            row.BorderBrush = new SolidColorBrush(Colors.Transparent);
1723
                            row.BorderBrush = new SolidColorBrush(Colors.Transparent);
1724
                            row.BorderThickness = new Thickness(0);
1724
                            row.BorderThickness = new Thickness(0);
1725
                        }
1725
                        }
1726
                        _wpIndex = data[48] - 1;
1726
                        _wpIndex = data[48] - 1;
1727
                        row = (DataGridRow)dgvWP.ItemContainerGenerator.ContainerFromIndex(_wpIndex);
1727
                        row = (DataGridRow)dgvWP.ItemContainerGenerator.ContainerFromIndex(_wpIndex);
1728
                        row.Background = new SolidColorBrush(Color.FromArgb(80, 0, 100, 255));
1728
                        row.Background = new SolidColorBrush(Color.FromArgb(80, 0, 255, 100));
1729
                        row.BorderBrush = new SolidColorBrush(Colors.Aqua);
1729
                        row.BorderBrush = new SolidColorBrush(Colors.SpringGreen);
1730
                        row.BorderThickness = new Thickness(2);
1730
                        row.BorderThickness = new Thickness(2);
1731
                        dgvWP.UpdateLayout();
1731
                        dgvWP.UpdateLayout();
1732
                    });
1732
                    });
1733
                _wpIndex = data[48]-1;
1733
                _wpIndex = data[48]-1;
1734
            }
1734
            }
Line 3545... Line 3545...
3545
        private void btnSendActiveWP_Click(object sender, RoutedEventArgs e)
3545
        private void btnSendActiveWP_Click(object sender, RoutedEventArgs e)
3546
        {
3546
        {
3547
            if (dgvWP.SelectedIndex > -1 && dgvWP.SelectedIndex < dtWaypoints.Rows.Count)
3547
            if (dgvWP.SelectedIndex > -1 && dgvWP.SelectedIndex < dtWaypoints.Rows.Count)
3548
            {
3548
            {
3549
                //if (_wpCount > 0)
3549
                //if (_wpCount > 0)
3550
                //    _sendWayPoint(dtWaypoints.Rows[dgvWP.SelectedIndex], -1,'s');
3550
                //    _sendWayPoint(dtWaypoints.Rows[dgvWP.SelectedIndex], -1, 's');
3551
                //else
3551
                //else
3552
                //    _sendWayPoint(dtWaypoints.Rows[dgvWP.SelectedIndex], 1,'s');
3552
                //    _sendWayPoint(dtWaypoints.Rows[dgvWP.SelectedIndex], 1, 's');
Line 3553... Line 3553...
3553
 
3553
 
3554
                int index = dgvWP.SelectedIndex;
3554
                int index = dgvWP.SelectedIndex;
3555
                Thread t = new Thread(() => _sendWPList(index));
3555
                Thread t = new Thread(() => _sendWPList(index));
Line 3564... Line 3564...
3564
                        row.BorderBrush = new SolidColorBrush(Colors.Transparent);
3564
                        row.BorderBrush = new SolidColorBrush(Colors.Transparent);
3565
                        row.BorderThickness = new Thickness(0);
3565
                        row.BorderThickness = new Thickness(0);
3566
                    }
3566
                    }
3567
                    _wpIndex = dgvWP.SelectedIndex;
3567
                    _wpIndex = dgvWP.SelectedIndex;
3568
                    row = (DataGridRow)dgvWP.ItemContainerGenerator.ContainerFromIndex(_wpIndex);
3568
                    row = (DataGridRow)dgvWP.ItemContainerGenerator.ContainerFromIndex(_wpIndex);
3569
                    row.Background = new SolidColorBrush(Color.FromArgb(80, 0, 100, 255));
3569
                    row.Background = new SolidColorBrush(Color.FromArgb(80, 0, 255, 100));
3570
                    row.BorderBrush = new SolidColorBrush(Colors.Aqua);
3570
                    row.BorderBrush = new SolidColorBrush(Colors.SpringGreen);
3571
                    row.BorderThickness = new Thickness(2);
3571
                    row.BorderThickness = new Thickness(2);
3572
                    dgvWP.UpdateLayout();
3572
                    dgvWP.UpdateLayout();
3573
                });
3573
                });
3574
            }
3574
            }
3575
        }
3575
        }
Line 3770... Line 3770...
3770
        }
3770
        }
3771
        private void btnEditWPDel_Click(object sender, RoutedEventArgs e)
3771
        private void btnEditWPDel_Click(object sender, RoutedEventArgs e)
3772
        {
3772
        {
Line 3773... Line 3773...
3773
 
3773
 
-
 
3774
        }
-
 
3775
        private void tbWPEdit_TouchDown(object sender, TouchEventArgs e)
-
 
3776
        {
-
 
3777
            _wpWEdit(sender);
3774
        }
3778
        }
3775
        private void tbWPEdit_KeyDown(object sender, KeyEventArgs e)
3779
        private void tbWPEdit_KeyDown(object sender, KeyEventArgs e)
-
 
3780
        {
-
 
3781
            _wpWEdit(sender);
-
 
3782
        }
-
 
3783
        void _wpWEdit(object sender)
3776
        {
3784
        {
3777
           if(!((TextBox)sender).IsReadOnly)
3785
            if (!((TextBox)sender).IsReadOnly)
3778
            {
3786
            {
Line 3779... Line 3787...
3779
                KeyPad.Keypad k = new KeyPad.Keypad(this);
3787
                KeyPad.Keypad k = new KeyPad.Keypad(this);
3780
 
3788
 
Line 3845... Line 3853...
3845
                        k.MAX = 254;
3853
                        k.MAX = 254;
3846
                        k.disableDecimal();
3854
                        k.disableDecimal();
3847
                        break;
3855
                        break;
3848
                }
3856
                }
3849
                k.Result = ((TextBox)sender).Text;
3857
                k.Result = ((TextBox)sender).Text;
3850
                if(k.ShowDialog() == true && k.Result.Length > 0)
3858
                if (k.ShowDialog() == true && k.Result.Length > 0)
3851
                    ((TextBox)sender).Text = k.Result;
3859
                    ((TextBox)sender).Text = k.Result;
3852
            }
3860
            }
3853
        }
-
 
Line -... Line 3861...
-
 
3861
 
3854
 
3862
        }
3855
        private void tbWPEditHeading_KeyDown(object sender, KeyEventArgs e)
3863
        private void tbWPEditHeading_KeyDown(object sender, KeyEventArgs e)
3856
        {
3864
        {
3857
           if(!tbWPEditHeading.IsReadOnly)
3865
           if(!tbWPEditHeading.IsReadOnly)
3858
            {
3866
            {
Line 4059... Line 4067...
4059
 
4067
 
4060
                    }
4068
                    }
4061
                    if(wpl.Count() > 0)
4069
                    if(wpl.Count() > 0)
4062
                    {
4070
                    {
4063
                        _clearMapMarkers(typeof(GMapRoute));
-
 
4064
                        //for (int k = 0; k < MainMap.Markers.Count;)
-
 
4065
                        //{
-
 
4066
                        //    GMapMarker p = MainMap.Markers[k];
-
 
4067
                        //    if (p.Shape.GetType() == typeof(GMapRoute))
-
 
4068
                        //        MainMap.Markers.Remove(p);
-
 
4069
                        //    else
-
 
4070
                        //        k++;
-
 
4071
                        //}
4071
                        _clearMapMarkers(typeof(GMapRoute));
4072
                        MapRoute mr = new MapRoute(wpl, "flying");
4072
                        MapRoute mr = new MapRoute(wpl, "flying");
4073
                        Dispatcher.Invoke(() =>
4073
                        Dispatcher.Invoke(() =>
4074
                        {
4074
                        {
4075
                            GMapRoute mRoute;
4075
                            GMapRoute mRoute;
4076
                            if (comboBoxRouteColor.SelectionBoxItem != null)
4076
                            if (comboBoxRouteColor.SelectionBoxItem != null)
4077
                            {
4077
                            {
4078
                                string s = comboBoxRouteColor.SelectionBoxItem.ToString();
4078
                                string s = comboBoxRouteColor.SelectionBoxItem.ToString();
4079
                                mRoute = new GMapRoute(wpList, _getBrush(s));
4079
                                mRoute = new GMapRoute(wpl, _getBrush(s));
4080
                            }
4080
                            }
4081
                            else
4081
                            else
Line 4082... Line 4082...
4082
                                mRoute = new GMapRoute(wpList, null);
4082
                                mRoute = new GMapRoute(wpl, null);
4083
 
4083
 
4084
                            MainMap.Markers.Add(mRoute);
4084
                            MainMap.Markers.Add(mRoute);