Beispiel #1
0
        private void timer_Init()
        {
            this.timer.Interval = new TimeSpan(0, 0, 1);
            this.timer.Tick    += new EventHandler(this.timer_Tick);
            this.timer.Start();
            DateTime NOW = DateTime.Now;

            GlobalData.StartTime    = Convert.ToInt64(UTCTimeOperate.ConvertDateTimeInt(NOW)).ToString();
            GlobalData.TrackName    = null;
            GlobalData.Time         = 0L;
            GlobalData.TrainingTime = "00:00:00";
            GlobalData.Distance     = "0";
            GlobalData.Velocity     = "0";
        }
Beispiel #2
0
        private void Data_Init()
        {
            this.speed      = 0.0;
            this.C_speed    = 0.0;
            this.power      = 0.0;
            this.distance   = 0.0;
            this.C_distance = 1.0;
            this.energy     = 0.0;
            this.time       = 0;
            this.gear       = 5;
            this.oldTime    = (this.nowTime = DateTime.Now.ToFileTimeUtc());
            this.oldSpeed   = (this.nowSpeed = 0.0);
            DateTime NOW = DateTime.Now;

            GlobalData.StartTime    = Convert.ToInt64(UTCTimeOperate.ConvertDateTimeInt(NOW)).ToString();
            GlobalData.Time         = 0L;
            GlobalData.Distance     = "0";
            GlobalData.Velocity     = "0";
            GlobalData.TrainingTime = "00:00:00";
        }
Beispiel #3
0
        private void Start_Click(object sender, RoutedEventArgs e)
        {
            bool flag = !this.bPause;

            if (flag)
            {
                bool flag2 = !GlobalData.Connectflag && !GlobalData.ANT_Connectflag;
                if (flag2)
                {
                    MessageBox.Show(MultiLanguage.Warn6, MultiLanguage.Warn_t, MessageBoxButton.OK, MessageBoxImage.Exclamation);
                    return;
                }
                this.bPause = true;
                this.timer_Init();
                bool connectflag = GlobalData.Connectflag;
                if (connectflag)
                {
                    GlobalData.SendGear(this.gear);
                }
                DateTime NOW = DateTime.Now;
                GlobalData.StartTime = Convert.ToInt64(UTCTimeOperate.ConvertDateTimeInt(NOW)).ToString();
                this.Start.Content   = MultiLanguage.Pause;
            }
            else
            {
                this.bPause = false;
                this.timer_Uninit();
                this.Start.Content = MultiLanguage.Start;
            }
            bool flag3 = !GlobalData.NormalTrainingflag;

            if (flag3)
            {
                GlobalData.NormalTrainingflag = true;
            }
        }