diff --git a/Assets/Scripts/Studio/UI/Panel_MQTTTestResult.cs b/Assets/Scripts/Studio/UI/Panel_MQTTTestResult.cs index d1282c2e..d81620f5 100644 --- a/Assets/Scripts/Studio/UI/Panel_MQTTTestResult.cs +++ b/Assets/Scripts/Studio/UI/Panel_MQTTTestResult.cs @@ -17,6 +17,9 @@ namespace Studio.UI public ScrollRect scrollView_TopicResults; public UI_MQTTTestResultItem prf_MQTTTestResultItem; public Button button_Close; + + private DateTime requestTime; + public struct MQTTTestResult { public string topic; @@ -48,6 +51,7 @@ namespace Studio.UI public void Open(string domain, string port) { Debug.Log($"Open MQTT Test Result Panel. Domain: {domain}, Port: {port}"); + requestTime = DateTime.Now; Item_Domain.SetValue(domain); Item_Port.SetValue(port); gameObject.SetActive(true); @@ -65,7 +69,7 @@ namespace Studio.UI } var item = Instantiate(prf_MQTTTestResultItem, scrollView_TopicResults.content); - item.SetResult(result.topic, result.message, result.payload); + item.SetResult(result.topic, result.message, result.payload, requestTime, DateTime.Now); item.transform.SetParent(scrollView_TopicResults.content); items.Add(item); } diff --git a/Assets/Scripts/Studio/UI/UI_MQTTTestResultItem.cs b/Assets/Scripts/Studio/UI/UI_MQTTTestResultItem.cs index 6f6b7a7f..eb41c57c 100644 --- a/Assets/Scripts/Studio/UI/UI_MQTTTestResultItem.cs +++ b/Assets/Scripts/Studio/UI/UI_MQTTTestResultItem.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using TMPro; using TriLibCore.Extensions; using UnityEngine; @@ -13,6 +14,9 @@ namespace Studio.UI public Transform Item_Topic; public UVCKeyValueItem Item_TopicPayload; public UVCKeyValueItem Item_TopicPacketSize; + public UVCKeyValueItem Item_LastRequestTime; + public UVCKeyValueItem Item_LastResponseTime; + public UVCKeyValueItem Item_LastSpandTime; public Button expand; public Button refresh; @@ -21,7 +25,9 @@ namespace Studio.UI Item_Topic = transform.DeepFind(nameof(Item_Topic)); Item_TopicPayload = transform.DeepFind(nameof(Item_TopicPayload)); Item_TopicPacketSize = transform.DeepFind(nameof(Item_TopicPacketSize)); - + Item_LastRequestTime = transform.DeepFind(nameof(Item_LastRequestTime)); + Item_LastResponseTime = transform.DeepFind(nameof(Item_LastResponseTime)); + Item_LastSpandTime = transform.DeepFind(nameof(Item_LastSpandTime)); refresh = Item_Topic.GetComponentInChildren