场景加载处理一些卡顿的情况
This commit is contained in:
1 parent
e7a3214cb5
commit
65fc5b5c50
35 files changed
+8668
-2075
No files matched your search
@@ -21,7 +21,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
{
|
||||
get
|
||||
{
|
||||
return CurrentUser.Id;
|
||||
return 10688;//CurrentUser.Id;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
@@ -109,7 +109,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
/// </summary>
|
||||
/// <param name="base64Image"></param>
|
||||
/// <returns></returns>
|
||||
public JsonResult<AddMapRecordResultModel> SaveData(CyclingModel cyclingModel, SelectParamModel selectParam, DateTime createTime, string base64Image = "")
|
||||
public JsonResult<AddMapRecordResultModel> SaveData(CyclingModel cyclingModel, SelectParamModel selectParam, string base64Image = "")
|
||||
{
|
||||
if (RiderDatas.Count <= 0)
|
||||
{
|
||||
@@ -126,13 +126,14 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
MapInterruptRecordApi service = new MapInterruptRecordApi();
|
||||
//AntManufacturer manufacturer = service.GetAntManufacturer(ManufacturerId);
|
||||
var recordId = Guid.NewGuid().ToString();
|
||||
var ticks = RiderDatas.Last().Ticks;
|
||||
var interruptRecord = new MapInterruptRecord
|
||||
{
|
||||
Id = recordId,
|
||||
RouteId = CurrentRoute.RouteInstance.Id,
|
||||
RouteName = CurrentRoute.RouteInstance.Name,
|
||||
TotalDistance = CurrentRoute.RouteInstance.Distance,
|
||||
UserId = BelongUserId,
|
||||
UserId = 10688,//BelongUserId,
|
||||
RecordFileName = newFileName + ".txt",
|
||||
Ftp = FTP,//FTP设置
|
||||
IF = Math.Round(IF, 2),
|
||||
@@ -145,9 +146,9 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
NormalizedPower = Math.Floor(NP),//标准化功率
|
||||
AveragePower = averagePower,//平均功率
|
||||
MaxPower = RiderDatas.Max(a => a._Power),//最大功率
|
||||
WeightKg = Math.Round(averagePower / PubCommData.CurrentUser.Weight, 2),
|
||||
Weight = PubCommData.CurrentUser.Weight,
|
||||
BicycleWeight = PubCommData.CurrentUser.BicycleWeight,
|
||||
WeightKg = Math.Round(averagePower / 65, 2),
|
||||
Weight = 65, //PubCommData.CurrentUser.Weight,
|
||||
BicycleWeight =7, //PubCommData.CurrentUser.BicycleWeight,
|
||||
ContinueMark = ContinueMark,
|
||||
ContinueIndex = ContinueIndex,
|
||||
IsDelete = false,
|
||||
@@ -159,11 +160,11 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
ManufacturerId = ManufacturerId,
|
||||
AntModelId = AntModelId,
|
||||
StartTime = StartTime,
|
||||
CreateTime = createTime,
|
||||
Ticks = RiderDatas.Last().Ticks,
|
||||
CreateTime = StartTime.AddSeconds(ticks),
|
||||
Ticks = ticks,
|
||||
Mode = cyclingModel.ToString(),
|
||||
Param = Newtonsoft.Json.JsonConvert.SerializeObject(selectParam),
|
||||
GlobalCyclingId = selectParam.GlobalCyclingId
|
||||
//Param = Newtonsoft.Json.JsonConvert.SerializeObject(selectParam),
|
||||
//GlobalCyclingId = selectParam.GlobalCyclingId
|
||||
};
|
||||
//var range = new MapSpeedRange().GetSpeedRange(RiderDatas, CurrentRoute.RouteInstance.Distance);
|
||||
interruptRecord.SpeedRange = null; //JsonConvert.SerializeObject(range);
|
||||
@@ -195,7 +196,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
stream.Close();
|
||||
files.Add(fname);
|
||||
}
|
||||
//TODO 截图
|
||||
#region TODO 截图
|
||||
if (!string.IsNullOrEmpty(base64Image))
|
||||
{
|
||||
//var imageName = path + "/" + Guid.NewGuid().ToString() + ".png";
|
||||
@@ -209,6 +210,7 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
//}
|
||||
//files.Add(imageName);
|
||||
}
|
||||
#endregion
|
||||
var result = service.Add(interruptRecord, files);
|
||||
return new JsonResult<AddMapRecordResultModel> { result = result.result, errMsg = result.errMsg, data = result.data };
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user