Beispiel #1
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            Point pt = e.GetPosition(this);

            TimeSample ts = _chart.HitTest(pt);

            if (ts != null)
            {
                (DataContext as ViewModels.MainWindowViewModel).Content = ts.Index + ": " + ts.Info;
            }
        }
Beispiel #2
0
        public static TimeSample Parse(string line)
        {
            char[]   delimiterChars = { ';' };
            string[] col            = line.Split(delimiterChars, StringSplitOptions.None);

            var ts = new TimeSample
            {
                Index    = int.Parse(col[0]),
                TimerMS  = int.Parse(col[1]),
                Dist     = int.Parse(col[2]),
                SysSpeed = int.Parse(col[3])
            };

            if (!string.IsNullOrEmpty(col[4]))
            {
                ts.XSpeed = int.Parse(col[4]);
            }
            if (!string.IsNullOrEmpty(col[5]))
            {
                ts.YSpeed = int.Parse(col[5]);
            }
            if (!string.IsNullOrEmpty(col[6]))
            {
                ts.ZSpeed = int.Parse(col[6]);
            }
            if (!string.IsNullOrEmpty(col[7]))
            {
                ts.ASpeed = int.Parse(col[7]);
            }
            if (!string.IsNullOrEmpty(col[8]))
            {
                ts.BSpeed = int.Parse(col[8]);
            }

            if (col.Length >= 20 && !string.IsNullOrEmpty(col[19]))
            {
                ts.Info = col[19];
            }

            return(ts);
        }
Beispiel #3
0
		public static TimeSample Parse(string line)
		{
			char[] delimiterChars = { ';' };
			string[] col = line.Split(delimiterChars, StringSplitOptions.None);

			TimeSample ts = new TimeSample();

			ts.Index = int.Parse(col[0]);
			ts.TimerMS = int.Parse(col[1]);
			ts.Dist = int.Parse(col[2]);
			ts.SysSpeed = int.Parse(col[3]);
			if (!string.IsNullOrEmpty(col[4])) ts.XSpeed = int.Parse(col[4]);
			if (!string.IsNullOrEmpty(col[5])) ts.YSpeed = int.Parse(col[5]);
			if (!string.IsNullOrEmpty(col[6])) ts.ZSpeed = int.Parse(col[6]);
			if (!string.IsNullOrEmpty(col[7])) ts.ASpeed = int.Parse(col[7]);
			if (!string.IsNullOrEmpty(col[8])) ts.BSpeed = int.Parse(col[8]);

			if (col.Length >= 20 && !string.IsNullOrEmpty(col[19])) ts.Info = col[19];

			return ts;
		}