This commit is contained in:
Administrator committed 2026-05-13 02:02:26 +08:00
commit 9694a80c89
2 files changed
+29 -10

No files matched your search

+19 -2
View File
@@ -10,6 +10,7 @@ namespace SunlightAggregationTerminal;
public partial class InfoPage : ContentPage
{
public static ObservableCollection<InfoItem> InfoItems { get; set; } = new();
private DateTime _lastRefreshTime = DateTime.MinValue;
public static string? _Name, _State, _MachineName, _Machine, _Information, _Model,
_Type, _ModelA, _ModelB, _ModelC, _ModelD, _ModelE, _ModelF;
@@ -27,8 +28,24 @@ public partial class InfoPage : ContentPage
});
//注册当前页面的下滑刷新
myRefreshView_.Refreshing += (sender, e) => {
TcpServer.TcpTransmit("{\"Command\":\"Info\"}");
myRefreshView_.IsRefreshing = false; };
// 5秒防抖判断:如果距离上次刷新不足5秒,直接取消本次操作
if ((DateTime.Now - _lastRefreshTime).TotalSeconds < 5)
{
myRefreshView_.IsRefreshing = false;
return;
}
try
{
// 更新刷新时间
_lastRefreshTime = DateTime.Now;
TcpServer.TcpTransmit("{\"Command\":\"Info\"}");
}
catch (Exception)
{
}
};
}
private void HandleUITrigger()
{