Esempio n. 1
0
        private void dataLoad()
        {
            int tnum = XMLHelper.RecordGetNum();

            this.num = tnum;
            bool flag = tnum > 0;

            if (flag)
            {
                for (int i = 0; i < tnum; i++)
                {
                    string     temp = XMLHelper.RecordGetName(i);
                    RidingData dr   = new RidingData();
                    dr.ID        = (i + 1).ToString();
                    dr.Name      = temp;
                    dr.TrackName = XMLHelper.RecordReader(temp, 0);
                    bool flag2 = XMLHelper.RecordReader(temp, 3) == "";
                    if (flag2)
                    {
                        dr.Time1 = null;
                    }
                    else
                    {
                        double start = Convert.ToDouble(XMLHelper.RecordReader(temp, 3));
                        dr.Time1 = UTCTimeOperate.ConvertIntDatetime(start).ToString();
                    }
                    dr.Time2    = XMLHelper.RecordReader(temp, 4);
                    dr.Distance = XMLHelper.RecordReader(temp, 5);
                    dr.Velocity = XMLHelper.RecordReader(temp, 6);
                    this.ObservableObj.Add(dr);
                }
            }
            this.listView.DataContext = this.ObservableObj;
        }
Esempio n. 2
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";
        }
Esempio n. 3
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";
        }
Esempio n. 4
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;
            }
        }