重置问题

This commit is contained in:
CaiYanPeng 2022-06-07 15:54:18 +08:00
parent c7afcbb01f
commit c333086e30
8 changed files with 3238 additions and 1429 deletions

File diff suppressed because it is too large Load Diff

View File

@ -207,6 +207,7 @@
"Heart Rate Monitor": "心率带",
"NO DEVICE": "无可用设备",
"CHOOSE DEVICE": "查看可用设备",
"NOCONN DEVICE": "未连接设备",
"Edit": "编辑",
"Record": "记录",
"More": "更多",
@ -454,6 +455,7 @@
"Smart Trainer": "Smart Trainer",
"NO DEVICE": "NO DEVICE",
"CHOOSE DEVICE": "CHOOSE DEVICE",
"NOCONN DEVICE": "NO CONNECTED DEVICE",
"CONNECT": "CONNECT",
"CLOSE": "CLOSE",
"PAIR": "PAIR",

View File

@ -190,7 +190,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: '2022-06-07 v1
m_Text: '2022-06-08 v1
'
--- !u!222 &43982092
@ -365,6 +365,92 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 154299661}
m_CullTransparentMesh: 0
--- !u!21 &197542326
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 446, g: 70, b: 70, a: 0}
--- !u!1 &273807000
GameObject:
m_ObjectHideFlags: 0
@ -615,92 +701,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 684809389}
m_CullTransparentMesh: 0
--- !u!21 &698887077
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 446, g: 70, b: 70, a: 0}
--- !u!1 &724627085
GameObject:
m_ObjectHideFlags: 0
@ -1053,6 +1053,92 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 90, y: -30, z: 0}
--- !u!21 &981288972
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 50, g: 50, b: 50, a: 0}
--- !u!1 &1378474435
GameObject:
m_ObjectHideFlags: 0
@ -1537,92 +1623,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1726804851}
m_CullTransparentMesh: 0
--- !u!21 &1947923732
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RoundedCornersTextureMaterial(Clone)
m_Shader: {fileID: 4800000, guid: 0bd2ec5d73751e34a814274a454bec41, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _BumpScale: 1
- _ColorMask: 15
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Height: 50
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Radius: 15
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _UVSec: 0
- _UseUIAlphaClip: 0
- _Width: 50
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _WidthHeightRadius: {r: 50, g: 50, b: 50, a: 0}
--- !u!1 &1962586925
GameObject:
m_ObjectHideFlags: 0
@ -1654,6 +1654,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
mMainPanel: {fileID: 0}
Root: {fileID: 0}
confirm: {fileID: 0}
--- !u!4 &1962586927
Transform:
m_ObjectHideFlags: 0

View File

@ -25,24 +25,24 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
/// </summary>
public int AverageStrokeRate { get; set; } = 0;
private UInt32 _totalDistance = 1;
public UInt32 TotalDistance
{
get => _totalDistance;
set
{
if (_totalDistance == 0 && value != 0 && StartEvent != null)
{
StartEvent.Invoke(null, new EventArgs());
}
_totalDistance = value;
}
}
//private UInt16 _instantaneousPace = 0;
//private UInt32 _totalDistance = 1;
public UInt32 TotalDistance { get; set; } = 1;
private UInt16 _instantaneousPace = 1;
/// <summary>
/// 即时配速
/// </summary>
public UInt16 InstantaneousPace { get; set; } = 0;
public UInt16 InstantaneousPace
{
get => _instantaneousPace;
set
{
if (_instantaneousPace == 0 && value != 0 && StartEvent != null)
{
StartEvent.Invoke(null, new EventArgs());
}
_instantaneousPace = value;
}
}
/// <summary>
/// 平均配速
/// </summary>
@ -264,7 +264,6 @@ namespace Assets.Scripts.Devices.Ble.Characteristic
}
//Debug.Log("拉力:" + string.Join(",",list));
}
//Debug.Log(output);
}
List<ushort> pullList;
public void Reset()

View File

@ -53,7 +53,8 @@ namespace Assets.Scripts.Devices.Ble.Devices
Debug.Log("中控台获取");
this.controlPointCharacteristic = character;
C2RowerData.IsEnabled = false;
Reset();
//Thread.Sleep(100);
//Reset();
}
else if (character.MatchGuid(ServiceUuids.Characteristics.RowerData))
{

View File

@ -459,6 +459,12 @@ public class RowerHomeScript : PFUIPanel
int truelyTime = 0;
private void StartFunc(object sender, EventArgs e)
{
if (UIManager.Instance.confirm!=null && UIManager.Instance.confirm.IsActive())
{
print("当前有弹窗");
return;
}
if (openTimer) return;
Id = Guid.NewGuid().ToString();
if (transform.parent.parent.Find("ModalPanel/RowerWelldone(Clone)") && transform.parent.parent.Find("ModalPanel/RowerWelldone(Clone)").gameObject.activeInHierarchy)
@ -773,6 +779,7 @@ public class RowerHomeScript : PFUIPanel
{
#if UNITY_EDITOR
var a = tempList[(tempx++) % tempList.Count];
Debug.Log(a);
PaintPullCurve((ushort)(a / 10));
if (RowerData == null) return;
#endif
@ -1152,12 +1159,11 @@ public class RowerHomeScript : PFUIPanel
//if (pullList.Count == 0)
if(pointCount == 0)
{
ClearChart("Player 2");
isPlay = true;
x = 0.1;
pointCount++;
pullList.Add(new DoubleVector2(x, y));
//SetChartData(pullList, historyPullList);
ClearChart();
SetChartData(x, y);
}
//else if (pullList.Count > 1)
@ -1167,29 +1173,34 @@ public class RowerHomeScript : PFUIPanel
pointCount++;
pullList.Add(new DoubleVector2(x, y));
SetChartData(x, y);
//SetChartData(pullList, historyPullList);
historyPullList = pullList.Select(x => x).ToList();
pullList.Clear();
pointCount = 0;
//ClearChart();
x = 0.1;
SetChartData(x, y);
//SetChartData(x, y);
pointCount = 1;
isPlay = true;
//isPlay = true;
pullList.Add(new DoubleVector2(x, y));
}
else
{
//只有0并且两秒没拉曲线消失
if (stopSeconds == 1)
if (stopSeconds == 1)
{
ClearChart();
ClearChart("Player 1");
ClearChart("Player 2");
//SetChartData(new List<DoubleVector2>(), new List<DoubleVector2>());
}
}
}
else
{
if (pullList.Count(x => x.y == 0) == pullList.Count)
{
ClearChart("Player 2");
pointCount = 0;
SetChartData(0.1, 0);
}
x += 0.1;
pointCount++;
pullList.Add(new DoubleVector2(x, y));
@ -1216,10 +1227,10 @@ public class RowerHomeScript : PFUIPanel
// x += 0.1f;
//}
}
void ClearChart()
void ClearChart(string cateName)
{
rowerGraphChartFeed.ClearChart();
graphChartFeed.ClearChart();
rowerGraphChartFeed.ClearChart(cateName);
graphChartFeed.ClearChart(cateName);
}
double preX, preY;
void SetChartData(double x, double y)
@ -1265,7 +1276,7 @@ public class RowerHomeScript : PFUIPanel
ShortUpdateData();
shortTimer += 0.25f;
}
if (openTimer && timer <= 0)
if (timer <= 0)
{
TimerTicks();
ticks++;
@ -1331,9 +1342,8 @@ public class RowerHomeScript : PFUIPanel
transform.Find("Ready/Img").gameObject.SetActive(flag);
transform.Find("Ready/Text").gameObject.SetActive(flag);
transform.Find("Ready/DeviceStatusConnect").gameObject.SetActive(flag);
if (!isFirstReset && flag)
if (flag && RowerData.TotalDistance != 0)
{
isFirstReset = true;
Rower.Reset();
//RowerData.Reset();
}

View File

@ -35,7 +35,7 @@ public class RowerDeviceView : MonoBehaviour
private GameObject mDisconnectButton;
private GameObject unconnectionPanel;
private GameObject connectionPanel;
private Text searchState;
private Text searchState,connSearchState;
private ConnectDeviceModal deviceModal;
private Text title;
private Text noDevice;
@ -69,7 +69,7 @@ public class RowerDeviceView : MonoBehaviour
searchState = unconnectionPanel.transform.Find("SearchState").GetComponent<Text>();
//mPairButton.SetActive(false);
connectionPanel = this.transform.Find("ConnectionPanel").gameObject;
connSearchState = connectionPanel.transform.Find("SearchState").GetComponent<Text>();
var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
var rect = ((RectTransform)transform).rect;
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height * 0.2f, 0));
@ -251,7 +251,7 @@ public class RowerDeviceView : MonoBehaviour
logo.sprite = sprite0;
searchState.text = App.GetLocalString("Searching...");
searchState.text = App.GetLocalString("CHOOSE DEVICE");
var hasDevice = false;
if (SensorType == SensorType.SpeedCadence)
{
@ -261,7 +261,7 @@ public class RowerDeviceView : MonoBehaviour
{
hasDevice = App.MainDeviceAdapter.GetDevices().Any(d => d.Sensor == SensorType);
}
noDevice.text = hasDevice ? App.GetLocalString("CHOOSE DEVICE") : App.GetLocalString("NO DEVICE");
noDevice.text = "";// App.GetLocalString("NOCONN DEVICE"); //hasDevice ? App.GetLocalString("CHOOSE DEVICE") : ;
if (hasDevice)
{
mSearchButton.SetActive(false);
@ -325,7 +325,6 @@ public class RowerDeviceView : MonoBehaviour
}
logo.sprite = sprite3;
//title.text = connectedDevice.Name;
if (connectedDevice.Network == NetworkType.BLE)
{

View File

@ -1182,7 +1182,7 @@ public class UIManager : MonoBehaviour
}
}
Confirm confirm = null;
public Confirm confirm;
public static void ShowConfirm(string title, string content, UnityAction action,int type = 2,UnityAction cancel = null)
{