重置问题
This commit is contained in:
1 parent
c7afcbb01f
commit
c333086e30
8 files changed
+3238
-1429
No files matched your search
@@ -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()
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
|
||||
Reference in new issue
Block a user