Beispiel #1
0
        private bool Timer_Tick()
        {
            if (RunTimer)
            {
                try
                {
                    if (CanSetTileData && BandClient != null)
                    {
                        SetTileData();
                    }
                }
                catch { }
                TotalTimeSpan  = TotalTimeSpan.Add(TimeSpan.FromSeconds(1));
                TotalTime.Text = TotalTimeSpan.Hours.ToString("00") + ":" + TotalTimeSpan.Minutes.ToString("00") + ":" + TotalTimeSpan.Seconds.ToString("00");

                ExTimeSpan  = ExTimeSpan.Add(TimeSpan.FromSeconds(1));
                ExTime.Text = ExTimeSpan.Minutes.ToString("00") + ":" + ExTimeSpan.Seconds.ToString("00");

                CalValue.Text = (BandManagement.GetValue(BandSensorType.Calories)).ToString("0");
                CalChart(CalBar, WorkoutManagement.PlanData.TotalCals, BandManagement.GetValue(BandSensorType.Calories));

                StepValue.Text = (BandManagement.GetValue(BandSensorType.Step)).ToString("0");
                CalChart(StepBar, WorkoutManagement.PlanData.TotalSteps, BandManagement.GetValue(BandSensorType.Step));

                HeartValue.Text = (BandManagement.GetValue(BandSensorType.HeartRate)).ToString("0");
                CalChart(HeartBar, WorkoutManagement.PlanData.AvgHeartRate, BandManagement.GetValue(BandSensorType.HeartRate));

                DistanceValue.Text = (BandManagement.GetValue(BandSensorType.Step) * 0.5).ToString("0");
                CalChart(DistanceBar, WorkoutManagement.PlanData.TotalSteps * 0.5, BandManagement.GetValue(BandSensorType.Step) * 0.5);
            }
            return(true);
        }
 public override bool IsPass()
 {
     if (!IsDone)
     {
         if (BandManagement.GetValue(SensorType) > Value)
         {
             return(true);
         }
     }
     return(false);
 }
 public override bool IsPass()
 {
     if (!IsDone)
     {
         if (BandManagement.GetValue(BandSensorType.Calories) > WorkoutManagement.PlanData.TotalCals - 2)
         {
             IsDone = true;
             return(true);
         }
     }
     return(false);
 }
 public override bool IsPass()
 {
     if (!IsDone)
     {
         if (BandManagement.GetValue(BandSensorType.HeartRate) > WorkoutManagement.PlanData.AvgHeartRate - 3)
         {
             IsDone = true;
             return(true);
         }
     }
     return(false);
 }
Beispiel #5
0
        private async void StopWorkout()
        {
            RunTimer = false;
            ExVideo.Stop();
            AppManagement.IsEventRuning = false;
            SetTileBeginData();
            BandManagement.Stop();
            await HttpClient.Post <string>("http://aloraha.com/api/report", new AddReportReq()
            {
                PlanID       = WorkoutManagement.PlanData.Id,
                AvgHeartRate = (float)BandManagement.GetValue(BandSensorType.HeartRate),
                TotalCals    = (float)BandManagement.GetValue(BandSensorType.Calories),
                TotalSteps   = (float)BandManagement.GetValue(BandSensorType.Step),
                BeginTime    = BeginTime,
                Duration     = (int)TotalTimeSpan.TotalSeconds
            });

            Browser.IsVisible = true;
            Browser.Uri       = "http://aloraha.com/report/workout//?inapp";
        }