骑行界面调整,底层逻辑细化
This commit is contained in:
1 parent
d5133ee7b0
commit
9a7830f46a
168 files changed
+19164
-393
No files matched your search
@@ -1,23 +1,49 @@
|
||||
using System;
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class Helper
|
||||
{
|
||||
public static string GetDataDire(string dirName = "")
|
||||
public static string GetDataDire(string pathName)
|
||||
{
|
||||
|
||||
//var parentPath = System.IO.Directory.GetParent(Environment.CurrentDirectory).FullName;
|
||||
var parentPath = " ";//TODO
|
||||
var path = Path.Combine(parentPath, "PowerFunData", dirName);
|
||||
if (!System.IO.Directory.Exists(path))
|
||||
return @"D:\unityproject\Test\"+ pathName;
|
||||
}
|
||||
public static double AveragePower(IList<TargetData> list)
|
||||
{
|
||||
return Math.Floor(list.Where(p => p._Power > -1).Average(a => a._Power));
|
||||
}
|
||||
/// <summary>
|
||||
/// 优化功率
|
||||
/// </summary>
|
||||
/// <param name="list"></param>
|
||||
/// <returns></returns>
|
||||
public static double GetNP(List<TargetData> list)
|
||||
{
|
||||
var _npinterval = new List<double>();
|
||||
var count = list.Count / 28;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
Directory.CreateDirectory(path);
|
||||
var list1 = list.Skip(i * 28).Take(28);
|
||||
double avgpower = Math.Pow((int)list1.Where(d => d._Power > -1).Average(a => a._Power), 4);
|
||||
_npinterval.Add(avgpower);
|
||||
}
|
||||
return path;
|
||||
double n = 0.25;
|
||||
if (_npinterval.Count == 0) return 0;
|
||||
return Math.Pow((_npinterval.Sum() / _npinterval.Count), n);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// TODO:获取Ftp
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static int GetFtp()
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
|
||||
public static string FormatTicks(int seconds)
|
||||
|
||||
Reference in new issue
Block a user