心率,阻力逻辑调整

This commit is contained in:
lishuo committed 2022-06-14 18:37:58 +08:00
1 parent f25d0b7b8c
commit 0202814f67
5 files changed
+68 -29

No files matched your search

@@ -25,24 +25,25 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
/// </summary>
public int AverageStrokeRate { get; set; } = 0;
//private UInt32 _totalDistance = 1;
public UInt32 TotalDistance { get; set; } = 1;
private UInt16 _instantaneousPace = 1;
/// <summary>
/// 即时配速
/// </summary>
public UInt16 InstantaneousPace
private UInt32 _totalDistance = 1;
public UInt32 TotalDistance
{
get => _instantaneousPace;
get => _totalDistance;
set
{
if (_instantaneousPace == 0 && value != 0 && StartEvent != null)
if (_totalDistance == 0 && value != 0 && StartEvent != null)
{
StartEvent.Invoke(this, null);
}
_instantaneousPace = value;
_totalDistance = value;
}
}
//private UInt16 _instantaneousPace = 1;
/// <summary>
/// 即时配速
/// </summary>
public UInt16 InstantaneousPace { get; set; } = 0;
/// <summary>
/// 平均配速
/// </summary>
@@ -1,5 +1,6 @@
using Assets.Scripts.Ble;
using System.Timers;
using UnityEngine;
namespace Assets.Scripts.Devices.Ble
{
@@ -35,7 +36,7 @@ namespace Assets.Scripts.Devices.Ble
this.managerStatusChanged -= value;
}
}
WclBleManagerStatus statusEnum = WclBleManagerStatus.RadioOff;
WclBleManagerStatus statusEnum = WclBleManagerStatus.RadioOn;
internal BleMobileThread() {
Initialize();//初始蓝牙
}
@@ -44,7 +45,8 @@ namespace Assets.Scripts.Devices.Ble
var self = this;
if (statusEnum == WclBleManagerStatus.RadioOff)
{
Initialize();
//Initialize();
BluetoothLEHardwareInterface.BluetoothEnable(true);
}
else
{
@@ -56,6 +58,7 @@ namespace Assets.Scripts.Devices.Ble
}
public void Initialize()
{
Debug.Log("Initialize");
var self = this;
BluetoothLEHardwareInterface.BluetoothEnable(true);
BluetoothLEHardwareInterface.Initialize(true, false, () =>