Subversion Repositories Projects

Rev

Rev 2399 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2399 Rev 2401
Line 771... Line 771...
771
                });
771
                });
772
            }
772
            }
773
            else
773
            else
774
                Dispatcher.Invoke(() => wpActiveMarker.Position = wpList[iIndex]);
774
                Dispatcher.Invoke(() => wpActiveMarker.Position = wpList[iIndex]);
Line -... Line 775...
-
 
775
 
775
 
776
            Dispatcher.Invoke(() => tbWPStatusHeight.Text = dtWaypoints.Rows[iIndex][5].ToString() + " m");
776
        }
777
        }
777
        void _clearHomePos()
778
        void _clearHomePos()
778
        {
779
        {
779
            MainMap.Markers.Remove(home);
780
            MainMap.Markers.Remove(home);
Line 1833... Line 1834...
1833
            i_16 = data[28];
1834
            i_16 = data[28];
1834
            i_16 = (Int16)(i_16 << 8);
1835
            i_16 = (Int16)(i_16 << 8);
1835
            iVal = data[27] + i_16;
1836
            iVal = data[27] + i_16;
1836
            Dispatcher.Invoke((Action)(() => tbWP.Text = ((double)iVal / (double)10).ToString("0.0 m")));
1837
            Dispatcher.Invoke((Action)(() => tbWP.Text = ((double)iVal / (double)10).ToString("0.0 m")));
1837
            Dispatcher.Invoke((Action)(() => lblWPRouteDistanceWP.Content = ((double)iVal / (double)10).ToString("0.0 m")));
1838
            Dispatcher.Invoke((Action)(() => lblWPRouteDistanceWP.Content = ((double)iVal / (double)10).ToString("0.0 m")));
-
 
1839
            Dispatcher.Invoke((Action)(() => tbWPStatusDistanceWP.Text = ((double)iVal / (double)10).ToString("0.0 m")));
Line 1838... Line 1840...
1838
 
1840
 
1839
            i_16 = data[45];
1841
            i_16 = data[45];
1840
            i_16 = (Int16)(i_16 << 8);
1842
            i_16 = (Int16)(i_16 << 8);
1841
            iVal = data[44] + i_16;
1843
            iVal = data[44] + i_16;
1842
        //    Dispatcher.Invoke((Action)(() => tbTopDistanceHP.Text = ((double)iVal / (double)10).ToString("0.0 m"))); //Distance to HP set by GPS on
1844
        //    Dispatcher.Invoke((Action)(() => tbTopDistanceHP.Text = ((double)iVal / (double)10).ToString("0.0 m"))); //Distance to HP set by GPS on
Line 1843... Line 1845...
1843
            Dispatcher.Invoke((Action)(() => tbHP.Text = ((double)iVal / (double)10).ToString("0.0 m"))); //Distance to HP set by GPS on
1845
            Dispatcher.Invoke((Action)(() => tbHP.Text = ((double)iVal / (double)10).ToString("0.0 m"))); //Distance to HP set by GPS on
1844
 
1846
 
-
 
1847
            Dispatcher.Invoke((Action)(() => tbWPIndex.Text = data[48].ToString())); //Waypoint index
1845
            Dispatcher.Invoke((Action)(() => tbWPIndex.Text = data[48].ToString())); //Waypoint index
1848
            Dispatcher.Invoke((Action)(() => lblWPIndexNC.Content = data[48].ToString()));
1846
            Dispatcher.Invoke((Action)(() => lblWPIndexNC.Content = data[48].ToString()));
1849
            Dispatcher.Invoke((Action)(() => lblWPStatusIndexNC.Content = data[48].ToString()));
1847
            if(data[48] > 0 && _wpIndex != data[48] -1 && wpList.Count >= data[48] -1)
1850
            if(data[48] > 0 && _wpIndex != data[48] -1 && wpList.Count >= data[48] -1)
1848
            {
1851
            {
1849
                _setActiveWP(data[48]-1);
1852
                _setActiveWP(data[48]-1);
Line 1887... Line 1890...
1887
                }
1890
                }
1888
            }
1891
            }
Line 1889... Line 1892...
1889
 
1892
 
1890
            Dispatcher.Invoke((Action)(() => tbWPCount.Text = data[49].ToString())); //Waypoints count
1893
            Dispatcher.Invoke((Action)(() => tbWPCount.Text = data[49].ToString())); //Waypoints count
-
 
1894
            Dispatcher.Invoke((Action)(() => lblWPCountNC.Content = data[49].ToString())); //Waypoints count
1891
            Dispatcher.Invoke((Action)(() => lblWPCountNC.Content = data[49].ToString())); //Waypoints count
1895
            Dispatcher.Invoke((Action)(() => lblWPStatusCountNC.Content = data[49].ToString())); //Waypoints count
1892
            _wpCount = data[49];
1896
            _wpCount = data[49];
Line 1893... Line 1897...
1893
            Dispatcher.Invoke((Action)(() => tbTopSats.Text = data[50].ToString())); //Satellites
1897
            Dispatcher.Invoke((Action)(() => tbTopSats.Text = data[50].ToString())); //Satellites
1894
 
1898
 
Line 1966... Line 1970...
1966
                }
1970
                }
1967
            }
1971
            }
Line 1968... Line 1972...
1968
 
1972
 
1969
            //Target hold time
1973
            //Target hold time
-
 
1974
            Dispatcher.Invoke((Action)(() => lblWPHoldTime.Content = data[73].ToString()+ " s"));
Line 1970... Line 1975...
1970
            Dispatcher.Invoke((Action)(() => lblWPHoldTime.Content = data[73].ToString()+ " s"));
1975
            Dispatcher.Invoke((Action)(() => tbWPStatusHoldTime.Text = data[73].ToString()+ " s"));
1971
 
1976
 
1972
            //--------------- NC Error ------------------------
1977
            //--------------- NC Error ------------------------
1973
            Dispatcher.Invoke((Action)(() => tbNCErr.Text = data[69].ToString()));  //NC Errornumber
1978
            Dispatcher.Invoke((Action)(() => tbNCErr.Text = data[69].ToString()));  //NC Errornumber
Line 2650... Line 2655...
2650
            GridSettings.Margin = new Thickness(GridSettings.Margin.Left, 36 * UIScaleTopSlider.Value, GridSettings.Margin.Right, GridSettings.Margin.Bottom);
2655
            GridSettings.Margin = new Thickness(GridSettings.Margin.Left, 36 * UIScaleTopSlider.Value, GridSettings.Margin.Right, GridSettings.Margin.Bottom);
2651
            if (GridMotors != null)
2656
            if (GridMotors != null)
2652
                GridMotors.Margin = new Thickness(GridMotors.Margin.Left, 36 * UIScaleTopSlider.Value, GridMotors.Margin.Right, GridMotors.Margin.Bottom);
2657
                GridMotors.Margin = new Thickness(GridMotors.Margin.Left, 36 * UIScaleTopSlider.Value, GridMotors.Margin.Right, GridMotors.Margin.Bottom);
2653
            if (GridSideBar != null)
2658
            if (GridSideBar != null)
2654
                GridSideBar.Margin = new Thickness(GridSideBar.Margin.Left, 36 * UIScaleTopSlider.Value, GridSideBar.Margin.Right, GridSideBar.Margin.Bottom);
2659
                GridSideBar.Margin = new Thickness(GridSideBar.Margin.Left, 36 * UIScaleTopSlider.Value, GridSideBar.Margin.Right, GridSideBar.Margin.Bottom);
-
 
2660
            if (WPStatus != null)
-
 
2661
                WPStatus.Margin = new Thickness(WPStatus.Margin.Left, 36 * UIScaleTopSlider.Value, WPStatus.Margin.Right, WPStatus.Margin.Bottom);
2655
            if (GridOSD != null)
2662
            if (GridOSD != null)
-
 
2663
            {
-
 
2664
                if(WPStatus.Visibility == Visibility.Visible)
-
 
2665
                    GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value + WPStatus.Margin.Bottom, GridOSD.Margin.Right, GridOSD.Margin.Bottom);
-
 
2666
                else
2656
                GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value, GridOSD.Margin.Right, GridOSD.Margin.Bottom);
2667
                    GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value, GridOSD.Margin.Right, GridOSD.Margin.Bottom);
-
 
2668
            }
2657
            if (GridData != null)
2669
            if (GridData != null)
2658
                GridData.Margin = new Thickness(GridData.Margin.Left, 36 * UIScaleTopSlider.Value, GridData.Margin.Right, GridData.Margin.Bottom);
2670
                GridData.Margin = new Thickness(GridData.Margin.Left, 36 * UIScaleTopSlider.Value, GridData.Margin.Right, GridData.Margin.Bottom);
2659
            if (GridWP != null)
2671
            if (GridWP != null)
2660
                GridWP.Margin = new Thickness(GridWP.Margin.Left, 36 * UIScaleTopSlider.Value, GridWP.Margin.Right, GridWP.Margin.Bottom);
2672
                GridWP.Margin = new Thickness(GridWP.Margin.Left, 36 * UIScaleTopSlider.Value, GridWP.Margin.Right, GridWP.Margin.Bottom);
2661
        }
2673
        }
Line 4290... Line 4302...
4290
                    myXmlTextWriter.Close();
4302
                    myXmlTextWriter.Close();
4291
                }
4303
                }
4292
            }
4304
            }
4293
        }
4305
        }
Line -... Line 4306...
-
 
4306
 
-
 
4307
        private void checkBoxShowWPStatus_Click(object sender, RoutedEventArgs e)
-
 
4308
        {
-
 
4309
            if (WPStatus.Visibility == Visibility.Visible)
-
 
4310
                GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value + 36, GridOSD.Margin.Right, GridOSD.Margin.Bottom);
-
 
4311
            else
-
 
4312
                GridOSD.Margin = new Thickness(GridOSD.Margin.Left, 36 * UIScaleTopSlider.Value, GridOSD.Margin.Right, GridOSD.Margin.Bottom);
Line 4294... Line 4313...
4294
 
4313
        }
4295
 
4314
 
4296
        private void btnLoadGPXLog_Click(object sender, RoutedEventArgs e)
4315
        private void btnLoadGPXLog_Click(object sender, RoutedEventArgs e)
4297
        {
4316
        {