结果页面移除划船记录&设备断开扔保留之前的厂商序列号

This commit is contained in:
lishuo committed 2022-07-18 14:31:14 +08:00
1 parent 2697103479
commit 5b39dd985b
12 files changed
+92 -87

No files matched your search

+9 -1
View File
@@ -365,9 +365,17 @@ public class MainController : BaseScene
}
ShowGameRoomInviteConfirm();
UIManager.UpdateJoinCompetition();//查询当前我参加的赛事
//await GetDeviceListAsync(); PC品牌
}
private async Task GetDeviceListAsync()
{
var result = await ConfigHelper.userApi.GetDeviceList();
if (result != null && result.result)
{
App.deviceList = result.data;
}
}
float emptyt = 0;//用于无消息计时
float t = 1f;
float scanTicks = 0;
@@ -293,7 +293,7 @@ namespace Assets.Scenes.Ride.Scripts
currentSlope = pointList[CurrentIndex].Grade;
//格式化坡度最大不能超过15,-15
PreSlope = PreSlope > 0 ?Math.Min(PreSlope, 15) : Math.Max(PreSlope, -15);
currentSlope = currentSlope > 0? Math.Min(PreSlope, 15) : Math.Max(PreSlope, -15);
currentSlope = currentSlope > 0? Math.Min(currentSlope, 15) : Math.Max(currentSlope, -15);
CurrentDistance = pointList[CurrentIndex].Distance;
//计算下一个海拔和坡度&当前区间距离
nextSlope = pointList[nextIndex].Grade > 0 ? Math.Min(pointList[nextIndex].Grade, 15) : Math.Max(pointList[nextIndex].Grade, -15);
@@ -38,25 +38,36 @@ namespace Assets.Scenes.Ride.Scripts
{
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
}
if (_device.Network == NetworkType.ANT)
{
var antDevice = _device as AbstractAntDevice;
ManufacturerId = antDevice.ManufacturerId;
AntModelId = antDevice.AntModelId;
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
}
else
{
var bleDevice = _device as BleDevice;
DeviceNumber = $"{ Helper.FormateMacAddress(bleDevice.Address) },{ ServiceUuids.GetBySensor(bleDevice.Sensor) }";
ManufacturerName = bleDevice.Name + "," + bleDevice.Network + "," + bleDevice.Sensor;
}
SetDeviceInfo();
}
return _device;
}
}
private void SetDeviceInfo()
{
if (_device.Network == NetworkType.ANT)
{
var antDevice = _device as AbstractAntDevice;
if (antDevice != null)
{
ManufacturerId = antDevice.ManufacturerId > 0 ? antDevice.ManufacturerId : ManufacturerId;
AntModelId = antDevice.AntModelId > 0 ? antDevice.AntModelId : AntModelId;
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
}
}
else
{
var bleDevice = _device as BleDevice;
if (bleDevice != null)
{
DeviceNumber = $"{ Helper.FormateMacAddress(bleDevice.Address) },{ ServiceUuids.GetBySensor(bleDevice.Sensor) }";
ManufacturerName = bleDevice.Name + "," + bleDevice.Network + "," + bleDevice.Sensor;
}
}
}
/// <summary>
/// 更新速度(KM/H)
///
@@ -130,6 +141,10 @@ namespace Assets.Scenes.Ride.Scripts
public bool CheckAnt()
{
//_antConnector = AntConnector.Instance();
if (_device == null || App.CurrentUser.FTP <= 0)
{
return false;
}
var devices = App.MainDeviceAdapter.GetDevices().Where(d => d.State == DeviceState.Connected && (d.Sensor == SensorType.Trainer || d.Sensor == SensorType.Power));
if (devices.Count() > 0)
{
@@ -138,34 +153,12 @@ namespace Assets.Scenes.Ride.Scripts
{
(_device as IRequiresRiderWeight).RiderWeight = App.CurrentUser.Weight;
}
if (_device.Network == NetworkType.ANT)
{
var antDevice = _device as AbstractAntDevice;
ManufacturerId = antDevice.ManufacturerId;
AntModelId = antDevice.AntModelId;
DeviceNumber = $"{ antDevice.DeviceNumber },{ antDevice.DeviceType}";
}
else
{
var bleDevice =_device as BleDevice;
DeviceNumber = $"{ bleDevice.Address },{ bleDevice.Sensor }";
ManufacturerName = bleDevice.Name + " " + bleDevice.Network + " " + bleDevice.Sensor;
}
SetDeviceInfo();
}
else
{
return false;
}
if (App.CurrentUser.FTP <= 0)
{
return false;
}
if (_device == null)
{
return false;
}
return true;
}
//设备列表
@@ -1,13 +1,8 @@
using UnityEngine;
using Assets.Scenes.Ride.Scripts.Model;
using UnityEngine.SceneManagement;
using System.Collections.Generic;
using System.Linq;
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
using System;
using ChartAndGraph;
using DG.Tweening;
using System.Collections;
using Assets.Scenes.Ride.Scripts.Model;
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
namespace Assets.Scenes.Ride.Scripts
@@ -159,10 +154,6 @@ namespace Assets.Scenes.Ride.Scripts
}
#endregion
//public void InitGraph(int index)
//{
// chartDataSourceScript.InitHorizontalScrolling(index);
//}
//移动海拔图头像
protected override void MoveGraphHead(bool init = false)
{