继骑&重骑骑行结果页细节调整
This commit is contained in:
1 parent
018699c944
commit
afba150d91
34 files changed
+3601
-2379
No files matched your search
@@ -7,6 +7,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@@ -17,6 +18,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected override void Init()
|
||||
{
|
||||
base.Init();
|
||||
totalDistance = mainController.selectParamModel.EndDistance;
|
||||
currentlatlong = mainController.GetCenterCoordinate();
|
||||
TrailRenderer trail = FindObjectOfType<TrailRenderer>();
|
||||
trail.startWidth = 0.6f;
|
||||
trail.endWidth = 0.6f;
|
||||
trail.startColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
||||
trail.endColor = new Color(0.9764706f, 0.1882353f, 0.5254902f, 0.65f);
|
||||
}
|
||||
TargetData targetData;
|
||||
/// <summary>
|
||||
@@ -31,17 +39,17 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
cadance = mainController.UpdateCadence();
|
||||
weight = App.CurrentUser.Weight;
|
||||
bicycleWeight = App.CurrentUser.BicycleWeight;
|
||||
Debug.Log(power);
|
||||
|
||||
#if UNITY_EDITOR
|
||||
power = 2000;//测试功率
|
||||
#endif
|
||||
mainController.TrackResistance(currentSlope);
|
||||
mainController.TrackResistance(currentSlope);//TODO
|
||||
speed = Helper.CalculateSpeed(elevation, currentSlope, power, weight, bicycleWeight);
|
||||
distance = mainController.UpdateDistance(speed);
|
||||
totalDistance += distance;
|
||||
//记录骑行数据
|
||||
|
||||
var recorderData = cyclingExcutor.recorderData;
|
||||
var recorderData = mainController.cyclingController.recorderData;
|
||||
targetData = new TargetData
|
||||
{
|
||||
Ticks = ticks,
|
||||
@@ -50,24 +58,31 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_Distance = totalDistance > mapData.TotalDistance ? mapData.TotalDistance : totalDistance,
|
||||
_Cadence = cadance,
|
||||
_HeartRate = heartRate,
|
||||
_Lat = nextlatlong.x,
|
||||
_Lon = nextlatlong.y
|
||||
_Lat = currentlatlong.x,
|
||||
_Lon = currentlatlong.y
|
||||
};
|
||||
recorderData.RiderDatas.Add(targetData);
|
||||
|
||||
}
|
||||
protected override void SendTcp()
|
||||
{
|
||||
mainController.cyclingController.Run(null);
|
||||
if (mainController.cyclingController != null)
|
||||
{
|
||||
mainController.cyclingController.Run(null);
|
||||
}
|
||||
}
|
||||
//上传数据
|
||||
public override void Upload()
|
||||
{
|
||||
mainController.isStart = false;
|
||||
string imageFileName = base.CaptureCamera(Camera.main, new Rect(Screen.width * 0f, Screen.height * 0f, Screen.width * 0.5f, Screen.height * 0.5f));
|
||||
cyclingExcutor.recorderData.IsCompleted = totalDistance == mapData.TotalDistance;
|
||||
cyclingExcutor.recorderData.EndDistance = totalDistance;
|
||||
cyclingExcutor.recorderData.SaveData(cyclingExcutor.Mode,null, imageFileName);
|
||||
mainController.cyclingController.recorderData.StartTime = startTime;
|
||||
mainController.cyclingController.recorderData.IsCompleted = totalDistance == mapData.TotalDistance;
|
||||
mainController.cyclingController.recorderData.EndDistance = totalDistance;
|
||||
mainController.cyclingController.recorderData.AntModelId = mainController.AntModelId;
|
||||
mainController.cyclingController.recorderData.ManufacturerId = mainController.ManufacturerId;
|
||||
mainController.cyclingController.recorderData.DeviceNumber = mainController.DeviceNumber;
|
||||
mainController.cyclingController.recorderData.SaveData(mainController.cyclingModel, mainController.selectParamModel, imageFileName);
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user