优化wifi
This commit is contained in:
parent
e22f0a13a0
commit
d6eda72140
@ -344,8 +344,10 @@ namespace Kill.UI.Pages
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_ANGLE_CONTROL, angleControl.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
Debug.Log($"[FovSettingPage] 角度设置成功: {selectedAngle}°");
|
||||
@ -400,8 +402,10 @@ namespace Kill.UI.Pages
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_VISIBLE_LASER_CONTROL, vllControl.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
Debug.Log($"[FovSettingPage] 可见激光设置成功: {(newVllState ? "开" : "关")}");
|
||||
@ -412,6 +416,7 @@ namespace Kill.UI.Pages
|
||||
else
|
||||
{
|
||||
Debug.LogError("[FovSettingPage] 可见激光设置失败");
|
||||
// 失败不更新UI,保持原状态
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -492,6 +497,7 @@ namespace Kill.UI.Pages
|
||||
{
|
||||
Debug.LogError("[FovSettingPage] 角度恢复失败");
|
||||
}
|
||||
LoadingUI.Hide();
|
||||
NotifyHomePageRefresh();
|
||||
ClosePage();
|
||||
}
|
||||
|
||||
@ -1207,6 +1207,14 @@ namespace Kill.UI.Pages
|
||||
InitDeviceUIFromConfig();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError("[HomePageCtrl] WiFi锁定设置失败");
|
||||
}
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Debug.LogError($"[HomePageCtrl] WiFi锁定设置异常: {ex.Message}");
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
||||
@ -445,8 +445,10 @@ namespace Kill.UI.Pages
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_DISTANCE_CONTROL, distanceControl.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
Debug.Log($"[LensSettingPage] 距离设置成功: {selectedLensValue}m");
|
||||
@ -500,8 +502,10 @@ namespace Kill.UI.Pages
|
||||
|
||||
if (DataManager.Instance.hasWifi && !DataManager.Instance.hasBluetooth)
|
||||
{
|
||||
LoadingUI.Show();
|
||||
bool success = await HomePageCtrl.Instance.SendBleCommandByWifiAsync(
|
||||
BLEConstants.CMD_VISIBLE_LASER_CONTROL, vllControl.ToBytes());
|
||||
LoadingUI.Hide();
|
||||
if (success)
|
||||
{
|
||||
Debug.Log($"[LensSettingPage] 可见激光设置成功: {(newVllState ? "开" : "关")}");
|
||||
@ -512,6 +516,7 @@ namespace Kill.UI.Pages
|
||||
else
|
||||
{
|
||||
Debug.LogError("[LensSettingPage] 可见激光设置失败");
|
||||
// 失败不更新UI,保持原状态
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -650,6 +655,7 @@ namespace Kill.UI.Pages
|
||||
{
|
||||
Debug.LogError("[LensSettingPage] 距离恢复失败");
|
||||
}
|
||||
LoadingUI.Hide();
|
||||
NotifyHomePageRefresh();
|
||||
ClosePage();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user