4.14修改,设备连接去掉ftms骑行台

This commit is contained in:
CaiYanPeng 2022-04-14 19:18:44 +08:00
parent 29e7219c21
commit f383c54507
18 changed files with 2511 additions and 10695 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,128 @@
fileFormatVersion: 2
guid: f0cadd1d737e0a84ab9ebafe34a5a8cb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: -1
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: -1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -330,8 +330,8 @@
"Route is public.": "路线已公开。", "Route is public.": "路线已公开。",
"RES": "阻力", "RES": "阻力",
"Peak F": "峰力", "Peak F": "峰力(kg)",
"AVG F": "均力", "AVG F": "均力(kg)",
"PWR": "功率", "PWR": "功率",
"COUNT": "桨次", "COUNT": "桨次",
"Count": "桨次", "Count": "桨次",
@ -344,7 +344,7 @@
"Stroke to continue the workout.": "请拉动手柄继续训练!", "Stroke to continue the workout.": "请拉动手柄继续训练!",
"Just Row": "自由划", "Just Row": "自由划",
"GO": "开始", "GO": "开始",
"Speed/500m": "500m配速", "Speed/500m": "500M配速",
"Share to": "分享到", "Share to": "分享到",
"VIEW MORE": "查看更多", "VIEW MORE": "查看更多",
"DEFINE": "确定", "DEFINE": "确定",
@ -686,8 +686,8 @@
"Route is public.": "Route is public.", "Route is public.": "Route is public.",
"RES": "RES", "RES": "RES",
"Peak F": "Peak F", "Peak F": "Peak F(kg)",
"AVG F": "AVG F", "AVG F": "AVG F(kg)",
"PWR": "PWR", "PWR": "PWR",
"COUNT": "COUNT", "COUNT": "COUNT",
"Count": "Count", "Count": "Count",
@ -700,7 +700,7 @@
"Stroke to continue the workout.": "Stroke to continue the workout.", "Stroke to continue the workout.": "Stroke to continue the workout.",
"Just Row": "Just Row", "Just Row": "Just Row",
"GO": "GO", "GO": "GO",
"Speed/500m": "Speed/500m", "Speed/500m": "Speed/500M",
"Share to": "Share to", "Share to": "Share to",
"VIEW MORE": "VIEW MORE", "VIEW MORE": "VIEW MORE",
"DEFINE": "DEFINE", "DEFINE": "DEFINE",

View File

@ -479,6 +479,84 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 381630235} m_GameObject: {fileID: 381630235}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &440850936
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 440850937}
- component: {fileID: 440850939}
- component: {fileID: 440850938}
m_Layer: 5
m_Name: Text (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &440850937
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 440850936}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1678571401}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -217.8, y: 97.989}
m_SizeDelta: {x: 184.31464, y: 50.011444}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &440850938
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 440850936}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: f878f11ea5771c548ac255f4e39b8e4b, type: 3}
m_FontSize: 38
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 223333
--- !u!222 &440850939
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 440850936}
m_CullTransparentMesh: 0
--- !u!1 &845512357 --- !u!1 &845512357
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -892,6 +970,102 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1083730966} m_GameObject: {fileID: 1083730966}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &1089465723
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1089465724}
- component: {fileID: 1089465727}
- component: {fileID: 1089465726}
- component: {fileID: 1089465725}
m_Layer: 5
m_Name: Panel
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1089465724
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089465723}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1557319131}
m_Father: {fileID: 1678571401}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 14, y: 0}
m_SizeDelta: {x: -100.005066, y: -278.73834}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1089465725
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089465723}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 385b7d1277b6c4007a84c065696e0f8c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 1
m_DownSamplingRate: 1
m_Softness: 1
m_Alpha: 1
m_IgnoreParent: 0
m_PartOfParent: 0
m_IgnoreSelfGraphic: 0
m_IgnoreSelfStencil: 0
--- !u!114 &1089465726
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089465723}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.7607844, g: 0.7607844, b: 0.7607844, a: 0.392}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 426bc972b7c244d40b428c79111a0d76, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1089465727
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1089465723}
m_CullTransparentMesh: 0
--- !u!1 &1362042230 --- !u!1 &1362042230
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1071,6 +1245,97 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1426317965} m_GameObject: {fileID: 1426317965}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &1557319130
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1557319131}
- component: {fileID: 1557319133}
- component: {fileID: 1557319132}
- component: {fileID: 1557319134}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1557319131
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1557319130}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1089465724}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 351, y: -81}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1557319132
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1557319130}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 426bc972b7c244d40b428c79111a0d76, type: 3}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &1557319133
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1557319130}
m_CullTransparentMesh: 0
--- !u!114 &1557319134
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1557319130}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 97bc2ebab6563400c95b036136d26ea6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Inverse: 0
m_MaskInteraction: 85
m_UseStencil: 1
m_RaycastFilter: 0
--- !u!1 &1678571397 --- !u!1 &1678571397
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -1166,6 +1431,9 @@ RectTransform:
- {fileID: 1083730967} - {fileID: 1083730967}
- {fileID: 100414010} - {fileID: 100414010}
- {fileID: 1366463779} - {fileID: 1366463779}
- {fileID: 2005809445}
- {fileID: 440850937}
- {fileID: 1089465724}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 3 m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
@ -1363,3 +1631,81 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1962740409} m_GameObject: {fileID: 1962740409}
m_CullTransparentMesh: 0 m_CullTransparentMesh: 0
--- !u!1 &2005809444
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2005809445}
- component: {fileID: 2005809447}
- component: {fileID: 2005809446}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &2005809445
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2005809444}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1678571401}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: -217.8, y: 148}
m_SizeDelta: {x: 184.31464, y: 50.011444}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2005809446
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2005809444}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 12800000, guid: f878f11ea5771c548ac255f4e39b8e4b, type: 3}
m_FontSize: 38
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 3
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 313113
--- !u!222 &2005809447
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2005809444}
m_CullTransparentMesh: 0

View File

@ -46,5 +46,10 @@ namespace Assets.Scripts.Apis
{ {
return await GetAsync<JsonResult<List<RowerRank>>>($"Rower/GetShadowList?type={rowerType.type}&typeValue={rowerType.value}"); return await GetAsync<JsonResult<List<RowerRank>>>($"Rower/GetShadowList?type={rowerType.type}&typeValue={rowerType.value}");
} }
public async Task<JsonResult<List<RowerRank>>> GetReRowShadowList(string id)
{
return await GetAsync<JsonResult<List<RowerRank>>>($"Rower/GetReRowShadowList?Id={id}");
}
} }
} }

View File

@ -38,7 +38,8 @@ namespace Assets.Scripts.Devices.Ant
SpeedCadence, SpeedCadence,
Trainer, Trainer,
VirtualPower, VirtualPower,
Rower Rower,
FtmsTrainer
} }
public enum NetworkType public enum NetworkType

View File

@ -62,13 +62,25 @@ namespace Assets.Scripts.Devices.Ble
{ {
if (!discoveredDevices.ContainsKey(device.Peripheral.Address)) if (!discoveredDevices.ContainsKey(device.Peripheral.Address))
{ {
Debug.Log($"发现设备{ device.Peripheral.Address }, \t\tName:{ device.Peripheral.Name }, type:{ device.SensorType }"); Debug.Log($"发现设备{ device.Peripheral.Address }, \t\tName:{ device.Peripheral.Name }, type:{ device.SensorType } 服务:{string.Join(",", device.Services)}");
if (string.IsNullOrWhiteSpace(device.Peripheral.Name)) if (string.IsNullOrWhiteSpace(device.Peripheral.Name))
{ {
return; return;
} }
if (device.SensorType == Ant.SensorType.Trainer) if (device.SensorType == Ant.SensorType.FtmsTrainer)
{
var device1 = new Ftms(device.Peripheral, hwInterface);
if (discoveredDevices.ContainsKey(device.Peripheral.Address))
{
discoveredDevices[device.Peripheral.Address] = device1;
}
else
{
discoveredDevices.Add(device.Peripheral.Address, device1);
}
}
else if (device.SensorType == Ant.SensorType.Trainer)
{ {
//var device1 = new Ftms(device.Peripheral, hwInterface); //var device1 = new Ftms(device.Peripheral, hwInterface);
//discoveredDevices.Add(device.Peripheral.Address, device0); //discoveredDevices.Add(device.Peripheral.Address, device0);
@ -122,7 +134,21 @@ namespace Assets.Scripts.Devices.Ble
{ {
//TODO:取消注释,自动连接设备 //TODO:取消注释,自动连接设备
//Debug.Log("自动连接" + device111.Id); //Debug.Log("自动连接" + device111.Id);
device111.Connect();
if (App.IsRowerMode == true)
{
if (device111.Sensor == Ant.SensorType.Rower || device111.Sensor == Ant.SensorType.HeartRate)
{
device111.Connect();
}
}
else if(App.IsRowerMode == false)
{
if (device111.Sensor != Ant.SensorType.Rower)
{
device111.Connect();
}
}
} }
} }

View File

@ -58,8 +58,8 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
//Debug.Log("数据" + string.Join(",", data)); //Debug.Log("数据" + string.Join(",", data));
if (data[0] == 53) if (data[0] == 53)
{ {
PeakDriveForce = LbsToNewton(Convert.ToDouble(BitConvertHelper.ToUInt16(data, 13)) / 10); PeakDriveForce = LbsToNewton(Convert.ToDouble(BitConvertHelper.ToUInt16(data, 13)) / 10,true);
AverageDriveForce = LbsToNewton(Convert.ToDouble(BitConvertHelper.ToUInt16(data, 15)) / 10); AverageDriveForce = LbsToNewton(Convert.ToDouble(BitConvertHelper.ToUInt16(data, 15)) / 10, true);
Debug.Log($"峰力值:{PeakDriveForce} 均力值{AverageDriveForce}"); Debug.Log($"峰力值:{PeakDriveForce} 均力值{AverageDriveForce}");
} }
else if (data[0] == 61) else if (data[0] == 61)
@ -67,7 +67,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
List<ushort> r = new List<ushort>(); List<ushort> r = new List<ushort>();
for (int i = 3; i < data.Length; i += 2) for (int i = 3; i < data.Length; i += 2)
{ {
ushort pull = data[i] < 10 ? (ushort)0 : Convert.ToUInt16(Math.Round(LbsToNewton(data[i]))); ushort pull = data[i] < 10 ? (ushort)0 : Convert.ToUInt16(Math.Round(LbsToNewton(data[i], true)));
r.Add(pull); r.Add(pull);
PullValue = pull; PullValue = pull;
} }
@ -105,7 +105,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
// isReadyStatus = data[2] == 1 || data[2] == 129; // isReadyStatus = data[2] == 1 || data[2] == 129;
//} //}
} }
private double LbsToNewton(double lbs) => 4.4482216 * lbs; private double LbsToNewton(double lbs,bool isKg = false) => 4.4482216 * lbs * (isKg ? (1f / 9.8f) : 1f);
public void SetUnavailable() public void SetUnavailable()
{ {
//throw new NotImplementedException(); //throw new NotImplementedException();

View File

@ -226,6 +226,7 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
for (int pullB = 4; pullB < data.Length; pullB += 2) for (int pullB = 4; pullB < data.Length; pullB += 2)
{ {
var val = BitConverter.ToUInt16(data, pullB); var val = BitConverter.ToUInt16(data, pullB);
val = Convert.ToUInt16(((double)val) /9.8f);
list.Add(val); list.Add(val);
PullValue = val; PullValue = val;

View File

@ -102,13 +102,19 @@ namespace Assets.Scripts.Devices.Ble.Devices
if (characteristic.MatchGuid(ServiceUuids.Characteristics.RowerData)) if (characteristic.MatchGuid(ServiceUuids.Characteristics.RowerData))
{ {
var c = base.Characteristics.SingleOrDefault(x => x.Uuid == ServiceUuids.Characteristics.RowerData); var c = base.Characteristics.SingleOrDefault(x => x.Uuid == ServiceUuids.Characteristics.RowerData);
c.HandleAttributeReceived(response.Data); if (c != null)
{
c.HandleAttributeReceived(response.Data);
}
} }
else else
{ {
var c = base.Characteristics.SingleOrDefault(x => x.Uuid == ServiceUuids.Characteristics.C2RowerData); var c = base.Characteristics.SingleOrDefault(x => x.Uuid == ServiceUuids.Characteristics.C2RowerData);
var data = new byte[] { characteristic.Id.ToByteArray()[0] }.Concat(response.Data).ToArray(); if (c != null)
c.HandleAttributeReceived(data); {
var data = new byte[] { characteristic.Id.ToByteArray()[0] }.Concat(response.Data).ToArray();
c.HandleAttributeReceived(data);
}
} }
//foreach (var item in base.Characteristics) //foreach (var item in base.Characteristics)
//{ //{

View File

@ -134,17 +134,14 @@ namespace Assets.Scripts.Ble
{ {
continue; continue;
} }
//Debug.Log($"設備信息,{item.IdGuid},{string.Join(";", item.IdByteArray)}"); //Debug.Log($"設備{App.IsRowerMode}信息,{item.IdGuid},{string.Join(";", item.IdByteArray)}");
if (item.IdByteArray == ServiceUuids.Ftms) if (item.IdByteArray == ServiceUuids.Ftms)
{ {
if (App.IsRowerMode == true) sensor = SensorType.Rower;
{ //else
sensor = SensorType.Rower; //{
} // sensor = SensorType.FtmsTrainer;
else //}
{
sensor = SensorType.Trainer;
}
} }
else if (item.IdByteArray == ServiceUuids.HeartRate) else if (item.IdByteArray == ServiceUuids.HeartRate)
{ {

View File

@ -45,7 +45,7 @@ public class HomeController : PFUIPanel
nav.SetButtonActive(new List<int> { 1, 3, 4, 6 },null,new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/RowerNew/ICON_mode_44"), () => nav.SetButtonActive(new List<int> { 1, 3, 4, 6 },null,new NewMainNav.CustomButton(Resources.Load<Sprite>("Images/RowerNew/ICON_mode_44"), () =>
{ {
UIManager.ShowRowerSelector(); UIManager.ShowRowerSelector();
})); },false));
newNav = nav; newNav = nav;
UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b => UIManager.AddEvent(transform.Find("TodayData/Datas/Distance").gameObject, EventTriggerType.PointerClick, b =>
{ {

View File

@ -227,6 +227,26 @@ public class RowerHomeScript : PFUIPanel
} }
Init(); Init();
} }
RowerResultModel reRowData = null;
public void ReRow(RowerResultModel r)
{
this.reRowData = r;
if (r!= null && r.Type.HasValue)
{
rowerType = new RowerType { type = r.Type.Value,value = (float)r.TypeValue.Value };
if (Rower != null)
{
Rower.Reset();
}
//RowerPanel/Rower/Bottom/Expected/Title
//var dw = rowerType.type == 1 ? $"{rowerType.value}M" : $"{(rowerType.value / 60).ToString("#0.00")}Min";
//bottom.Find("Expected/Title").GetComponent<Text>().text = $"EST\n/ {dw}";
var dw = rowerType.type == 1 ? $"" : $"\nM";
bottom.Find("Expected/Title").GetComponent<Text>().text = $"{App.GetLocalString("EST")}{dw}";
}
}
private void Discard() private void Discard()
{ {
transform.Find("Stopped").gameObject.SetActive(false); transform.Find("Stopped").gameObject.SetActive(false);
@ -264,8 +284,8 @@ public class RowerHomeScript : PFUIPanel
//mainNav.ShowRowerTab(); //mainNav.ShowRowerTab();
transform.MyDOFade(); transform.MyDOFade();
Debug.Log("140,开始扫描"); //Debug.Log("140,开始扫描");
App.MainDeviceAdapter.StartScan(); //App.MainDeviceAdapter.StartScan();
Init(); Init();
//transform.Find("Left/Rower").GetComponent<RowerAnimation>().StartAnimation(); //transform.Find("Left/Rower").GetComponent<RowerAnimation>().StartAnimation();
} }
@ -484,7 +504,7 @@ public class RowerHomeScript : PFUIPanel
{ {
Rower.Reset(); Rower.Reset();
} }
GetComponent<RowerMultiModeScript>().GetShadowList(rowerType); GetComponent<RowerMultiModeScript>().GetShadowList(rowerType, reRowData);
btnStart.tag = "Start"; btnStart.tag = "Start";
btnStart.GetComponent<Image>().sprite = spriteDict["Start"]; btnStart.GetComponent<Image>().sprite = spriteDict["Start"];
left.Find("Rower").GetComponent<Image>().sprite = spriteDict[0]; left.Find("Rower").GetComponent<Image>().sprite = spriteDict[0];
@ -558,7 +578,7 @@ public class RowerHomeScript : PFUIPanel
private void ResChanged(object sender, EventArgs e) private void ResChanged(object sender, EventArgs e)
{ {
print("收到阻力" + sender); print("收到阻力" + sender);
if ((Convert.ToSingle(sender) > 50) && slider) if ((Convert.ToSingle(sender) >= 50) && slider)
{ {
slider.GetComponent<PFUISlider>().SetValue((Convert.ToSingle(sender) - 50) / 300f); slider.GetComponent<PFUISlider>().SetValue((Convert.ToSingle(sender) - 50) / 300f);
} }
@ -578,7 +598,7 @@ public class RowerHomeScript : PFUIPanel
private void ReturnHome() private void ReturnHome()
{ {
if (checkRowing()) return; if (checkRowing()) return;
Disconnect(); //Disconnect();
UIManager.ShowHomePanel(); UIManager.ShowHomePanel();
UIManager.ShowRowerSelector(); UIManager.ShowRowerSelector();
} }

View File

@ -141,7 +141,7 @@ public class RouteItem : MonoBehaviour
UIManager.ShowConfirm("Re-Rowing", "Rowing again?", () => UIManager.ShowConfirm("Re-Rowing", "Rowing again?", () =>
{ {
UIManager.CloseConfirm(); UIManager.CloseConfirm();
UIManager.ShowRowerPanel(); UIManager.ShowRowerPanel(result);
}); });
}); });
} }

View File

@ -1,4 +1,5 @@
using System.Collections; using Assets.Scripts;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@ -16,6 +17,17 @@ public class RowerDevicePanel : PFUIPanel
void Start() void Start()
{ {
}
public override void Show()
{
base.Show();
print("开启扫描");
#if UNITY_ANDROID || UNITY_IOS
App.MainDeviceAdapter.StartScan();
#if UNITY_ANDROID
Utils.CallAndroidMethod("OpenLocationService");
#endif
#endif
} }
float timer = 1f; float timer = 1f;
// Update is called once per frame // Update is called once per frame

View File

@ -172,11 +172,11 @@ public class RowerMultiModeScript : MonoBehaviour
public int sumdiff { get; set; } public int sumdiff { get; set; }
} }
public Dictionary<int, RankDiff> rankDiffDict; public Dictionary<int, RankDiff> rankDiffDict;
public async void GetShadowList(RowerTaskPanel.RowerType rowerType) public async void GetShadowList(RowerTaskPanel.RowerType rowerType, RowerResultModel reRowData)
{ {
this.rowerType = rowerType; this.rowerType = rowerType;
currentSecond = -1; currentSecond = -1;
var res = await ConfigHelper.rowerApi.GetShadowList(rowerType); var res = reRowData ==null? await ConfigHelper.rowerApi.GetShadowList(rowerType): await ConfigHelper.rowerApi.GetReRowShadowList(reRowData.Id);
shadowList = res.data; shadowList = res.data;
//foreach (var t in traceList) //foreach (var t in traceList)
//{ //{
@ -304,7 +304,7 @@ public class RowerMultiModeScript : MonoBehaviour
var width = t.Find("Main").GetComponent<RectTransform>().sizeDelta.x - t.Find("Main/Boat").GetComponent<RectTransform>().sizeDelta.x; var width = t.Find("Main").GetComponent<RectTransform>().sizeDelta.x - t.Find("Main/Boat").GetComponent<RectTransform>().sizeDelta.x;
var diffWidth = data.currentDistance - mineData.currentDistance + 50; var diffWidth = data.currentDistance - mineData.currentDistance + 50;
if (data.currentDistance <= 50) if (data.currentDistance <= 50 && mineData.currentDistance <= 50)
{ {
diffWidth = data.currentDistance; diffWidth = data.currentDistance;
} }
@ -335,22 +335,31 @@ public class RowerMultiModeScript : MonoBehaviour
{ {
var ani = DOTween.Sequence(); var ani = DOTween.Sequence();
var _d = data.list[currentSecond]; var _d = data.list[currentSecond];
if (currentSecond > 0) if (currentSecond > 0 && _d.Pace > 0)
{ {
var _pred = data.list[currentSecond - 1]; var spDict = GetComponent<RowerHomeScript>().spriteDict;
if (_pred.StrokeCount != _d.StrokeCount) int spDictIndex = 0;
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.2f));
ani.AppendCallback(() =>
{ {
//上次划桨次数和这次不一样 说明需要划桨一次 int spDictIndex2 = 14;
var spDict = GetComponent<RowerHomeScript>().spriteDict; DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.4f);
int spDictIndex = 0; });
ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.2f)); ani.Play();
ani.AppendCallback(() => //var _pred = data.list[currentSecond - 1];
{ //if (_pred.StrokeCount != _d.StrokeCount)
int spDictIndex2 = 14; //{
DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.4f); // //上次划桨次数和这次不一样 说明需要划桨一次
}); // var spDict = GetComponent<RowerHomeScript>().spriteDict;
ani.Play(); // int spDictIndex = 0;
} // ani.Join(DOTween.To(() => spDictIndex, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 14, 0.2f));
// ani.AppendCallback(() =>
// {
// int spDictIndex2 = 14;
// DOTween.To(() => spDictIndex2, x => t.Find("Main/Boat").GetComponent<Image>().sprite = spDict[x], 0, 0.4f);
// });
// ani.Play();
//}
} }
} }
} }
@ -432,7 +441,17 @@ public class RowerMultiModeScript : MonoBehaviour
if (diff.diff != 0) if (diff.diff != 0)
{ {
sq.Join(t.parent.DOLocalMoveY(-47 * (diff.rank - 1) - 21.5f, 0.9f).SetEase(Ease.OutBounce)); //if (diff.diff > 0)
//{
// t.parent.SetAsLastSibling();
//}
sq.Join(t.parent.DOLocalMoveY(-47 * (diff.rank - 1) - 21.5f, 0.9f));
var sq1 = DOTween.Sequence();
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(0.2f, 0.45f));
sq1.Append(t.GetComponent<CanvasGroup>().DOFade(1f, 0.45f));
//sq1.SetEase(Ease.InOutCubic);
sq.Join(sq1);
sq.SetEase(Ease.InOutCubic);
//sq.Append(t.GetComponent) //sq.Append(t.GetComponent)
} }
t.parent.name = i.ToString(); t.parent.name = i.ToString();
@ -701,12 +720,12 @@ public class RowerMultiModeScript : MonoBehaviour
{ {
game.transform.Find("Content/Rank").GetComponent<Text>().text = item.currentRank.ToString("00"); game.transform.Find("Content/Rank").GetComponent<Text>().text = item.currentRank.ToString("00");
game.transform.Find("Content/NickName").GetComponent<Text>().text = item.NickName; game.transform.Find("Content/NickName").GetComponent<Text>().text = item.NickName;
Utils.DisplayImageTempDict(game.transform.Find("Content/Avatar").GetComponent<RawImage>(), item.Avatar, caches); //Utils.DisplayImageTempDict(game.transform.Find("Content/Avatar").GetComponent<RawImage>(), item.Avatar, caches);
var _c = countryList.FirstOrDefault(x => item.Country == x.country); //var _c = countryList.FirstOrDefault(x => item.Country == x.country);
if (_c != null) //if (_c != null)
{ //{
game.transform.Find("Content/Country").GetComponent<Image>().sprite = Resources.Load<Sprite>(_c.source); // game.transform.Find("Content/Country").GetComponent<Image>().sprite = Resources.Load<Sprite>(_c.source);
} //}
int _d = 0, _p = 0; int _d = 0, _p = 0;
if (currentSecond < 0 || item.list.Count == 0) if (currentSecond < 0 || item.list.Count == 0)
{ {
@ -955,6 +974,7 @@ public class RowerMultiModeScript : MonoBehaviour
void Update() void Update()
{ {
#if UNITY_EDITOR #if UNITY_EDITOR
//return;
timer -= Time.deltaTime; timer -= Time.deltaTime;
if (timer < 0) if (timer < 0)
{ {

View File

@ -16,6 +16,7 @@ using System;
using Assets.Scenes.Ride.Scripts; using Assets.Scenes.Ride.Scripts;
using UnityEngine.SceneManagement; using UnityEngine.SceneManagement;
using System.Threading; using System.Threading;
using Assets.Scripts.Devices.Ant;
public class UIManager : MonoBehaviour public class UIManager : MonoBehaviour
{ {
@ -269,7 +270,7 @@ public class UIManager : MonoBehaviour
return this.GetPanelInstance("RowerPanel", ref this.mRowerHomeScript); return this.GetPanelInstance("RowerPanel", ref this.mRowerHomeScript);
} }
} }
public static void ShowRowerPanel() public static void ShowRowerPanel(RowerResultModel r = null)
{ {
App.IsRowerMode = true; App.IsRowerMode = true;
// App.MainDeviceAdapter.ClearDevice(); // App.MainDeviceAdapter.ClearDevice();
@ -279,6 +280,7 @@ public class UIManager : MonoBehaviour
stack.Clear(); stack.Clear();
UIManager.Instance.MainPanel.GetComponent<Image>().sprite = UIManager.Instance.MainPanel.GetComponent<Image>().sprite =
Resources.Load<Sprite>("Images/RowerNew/bg_huachuanji"); Resources.Load<Sprite>("Images/RowerNew/bg_huachuanji");
UIManager.Instance.RowerHomeScript.ReRow(r);
UIManager.Show(UIManager.Instance.RowerHomeScript, UIManager.Instance.MainPanel); UIManager.Show(UIManager.Instance.RowerHomeScript, UIManager.Instance.MainPanel);
} }
//结束页 //结束页
@ -327,6 +329,14 @@ public class UIManager : MonoBehaviour
public static void ShowRowerSelector() public static void ShowRowerSelector()
{ {
Debug.Log("进入Rower"); Debug.Log("进入Rower");
foreach (var d in App.MainDeviceAdapter.GetDevices())
{
if (d.State == DeviceState.Connected || d.State == DeviceState.Connecting)// && (d.Sensor == SensorType.Trainer || d.Sensor == SensorType.Rower || d.Sensor == SensorType.HeartRate)
{
d.Disconnect();
}
}
App.MainDeviceAdapter.StopScan();
UIManager.Show(UIManager.Instance.RowerSelector, null, true); UIManager.Show(UIManager.Instance.RowerSelector, null, true);
} }
/*划船机页面*/ /*划船机页面*/
@ -341,6 +351,7 @@ public class UIManager : MonoBehaviour
} }
public static void ShowRowerDevicePanel() public static void ShowRowerDevicePanel()
{ {
//App.MainDeviceAdapter.StartScan();
UIManager.Show(UIManager.Instance.RowerDevicePanel, null, true); UIManager.Show(UIManager.Instance.RowerDevicePanel, null, true);
} }