细节调整

This commit is contained in:
suntao committed 2020-10-27 10:20:47 +08:00
1 parent a9e8137aaa
commit fec18db7a8
10 files changed
+135 -72

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ namespace OnlineUserPool.Model
{
get
{
return DateTime.Now.Subtract(LastActiveTime).TotalSeconds > 6000;
return DateTime.Now.Subtract(LastActiveTime).TotalSeconds > 60;
}
}
+40 -23
View File
@@ -12,7 +12,7 @@ namespace OnlineUserPool.Model
public int RouteId { get; set; }
public int Ticks { get; set; }
public int Ticks { get; set; } = -1;
public Guid Id { get; set; }
@@ -21,6 +21,10 @@ namespace OnlineUserPool.Model
public string WxHeadImg { get; set; }
public string NickName { get; set; }
/// <summary>
/// 体重,用于计算功率体重比
/// </summary>
public double Weight { get; set; }
/// <summary>
/// 总点位数据
@@ -40,27 +44,28 @@ namespace OnlineUserPool.Model
/// </summary>
public int CurrentIndex
{
get
{
if (_BeginIndex != 0)
{
_BeginIndex++;
if (End)
{
return this.Count - 1;
}
return this._BeginIndex;
}
else
{
_BeginIndex = 1;
return _BeginIndex;
Random random = new Random();
_BeginIndex = random.Next(0, this.Count);
return _BeginIndex;
}
}
}
get; set;
//get
//{
//if (_BeginIndex != 0)
//{
// _BeginIndex++;
// if (End)
// {
// return this.Count - 1;
// }
// return this._BeginIndex;
//}
//else
//{
// _BeginIndex = 1;
// return _BeginIndex;
// Random random = new Random();
// _BeginIndex = random.Next(0, this.Count);
// return _BeginIndex;
//}
//}
} = -1;
/// <summary>
/// 是否已到头
@@ -69,7 +74,8 @@ namespace OnlineUserPool.Model
{
get
{
return this._BeginIndex >= this.Count;
//return this._BeginIndex >= this.Count;
return this.CurrentIndex >= this.Count;
}
}
@@ -79,7 +85,18 @@ namespace OnlineUserPool.Model
/// <returns></returns>
public TargetData GetCurrentTargetData()
{
if(CurrentIndex > this.record.Length - 1)
{
return TargetData.Read(this.record[this.record.Length - 1]);
}
return TargetData.Read(this.record[CurrentIndex]);
}
public double GetPreDistance()
{
if (CurrentIndex < 1) return 0;
return TargetData.Read(this.record[CurrentIndex - 1])._Distance;
}
}
}
+15 -4
View File
@@ -13,10 +13,12 @@ namespace OnlineUserPool.Model
public bool exit = false;
public double Speed { get; set; }
/// <summary>
/// 需要展示的属性
/// </summary>
public string Prop { get; set; }
///// <summary>
///// 需要展示的属性
///// </summary>
//public string Prop { get; set; }
public double PreDistance { get; set; }
public double EndDistance { get; set; }
/// <summary>
@@ -29,5 +31,14 @@ namespace OnlineUserPool.Model
public byte CommandType { get; set; }
public bool IsVirtual { get; set; }
//public double Power { get; set; }
//public double Weight { get; set; }
/// <summary>
/// 功率体重比
/// </summary>
public double WeightKg { get; set; }
}
}
+5 -1
View File
@@ -51,7 +51,11 @@ namespace OnlineUserPool.Model
{
target._Lat = double.Parse(split[6]);
target._Lon = double.Parse(split[7]);
target._Bearing = double.Parse(split[8]);
if (split.Length >= 9)
{
target._Bearing = double.Parse(split[8]);
}
}
return target;
}