修改日志-20240709-2030:

1、修改默认堆场、相机、计量秤图标名称;
2、增加接口日志打印
This commit is contained in:
Afeijia 2024-07-09 20:30:11 +08:00
parent 52bac73a8a
commit 19e8b74416
5 changed files with 141 additions and 135 deletions

View File

@ -66,7 +66,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: New Text
m_text: "\u672A\u77E5\u8BA1\u91CF\u8BBE\u5907"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 39d48bca937920746ae0cfa602467f63, type: 2}
m_sharedMaterial: {fileID: 3298889249665915115, guid: 39d48bca937920746ae0cfa602467f63,

View File

@ -66,7 +66,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\u554A\u5B9E\u6253\u5B9E\u7684\u6492\u554A\u5B9E\u6253\u5B9E\u7684"
m_text: "\u672A\u77E5\u5806\u573A"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 39d48bca937920746ae0cfa602467f63, type: 2}
m_sharedMaterial: {fileID: 3298889249665915115, guid: 39d48bca937920746ae0cfa602467f63,

View File

@ -282,7 +282,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: "\u7801\u5934XX\u4E00\u53F7\u6CCA\u4F4D"
m_text: "\u672A\u77E5\u76F8\u673A"
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 7189cdc95f54eb84ba6a7b8655aebb40, type: 2}
m_sharedMaterial: {fileID: 1594732787684875815, guid: 7189cdc95f54eb84ba6a7b8655aebb40,

View File

@ -12,7 +12,7 @@ public class Configure
{
public string MONITOR_ID { get; set; }
public Dictionary<string, string> DATA { get;set; }
public Dictionary<string, string> DATA { get; set; }
}
public class ApiManager : Singleton<ApiManager>
@ -75,7 +75,6 @@ public class ApiManager : Singleton<ApiManager>
{
base.Awake();
//var _ip_str_url = Path.Combine(Application.streamingAssetsPath, "configure.json");
//StartCoroutine(RequestBase.Get(_ip_str_url, (_data, _error) =>
//{
@ -107,7 +106,7 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"<color=#ff0000> {_error} </color>");
Debug.Log($"本地api配置错误<color=#ff0000> {_error} </color>");
}
else
{
@ -121,7 +120,7 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"<color=#ff0000> {_error} </color>");
Debug.Log($"本地camera配置错误<color=#ff0000> {_error} </color>");
}
else
{
@ -141,7 +140,7 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"<color=#ff0000> {_error} </color>");
Debug.Log($"本地yard配置错误<color=#ff0000> {_error} </color>");
}
else
{
@ -176,6 +175,7 @@ public class ApiManager : Singleton<ApiManager>
/// <returns></returns>
IEnumerator GetCameraList()
{
Debug.Log("相机接口等待执行");
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
var _get_camera_list = IpAddress + ApiDic["GetCameraList"];
@ -193,10 +193,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"<color=#ff0000> {_error} </color>");
Debug.Log($"相机接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log($"相机数据:{_data}");
T_BAS_CAMERA_List = JsonConvert.DeserializeObject<DataBase<List<T_BAS_CAMERA>>>(_data).data;
}
}));
@ -210,6 +211,7 @@ public class ApiManager : Singleton<ApiManager>
/// <returns></returns>
IEnumerator GetYardInformation()
{
Debug.Log("堆场接口等待执行");
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
var _get_yard_information = IpAddress + ApiDic["GetYardList"];
@ -228,10 +230,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"<color=#ff0000> {_error} </color>");
Debug.Log($"堆场接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log($"堆场数据:{_data}");
T_BAS_YARD_List = JsonConvert.DeserializeObject<DataBase<List<T_BAS_YARD>>>(_data).data;
}
}));
@ -250,11 +253,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"堆场库存信息接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log(_data);
Debug.Log("堆场库存信息数据:" + _data);
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
_callback?.Invoke(_t_object);
}
@ -270,9 +273,9 @@ public class ApiManager : Singleton<ApiManager>
/// <returns></returns>
IEnumerator GetBeltScale()
{
Debug.Log("计量秤接口等待执行");
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
var _get_belt_scale = IpAddress + ApiDic["GetWeighterList"];
#if UNITY_EDITOR
if (CallForTest.instance != null)
{
@ -288,10 +291,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"<color=#ff0000> {_error} </color>");
Debug.Log($"计量秤接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log($"皮带秤数据:{_data}");
T_BAS_ELEC_WEIGHTER_List = JsonConvert.DeserializeObject<DataBase<List<T_BAS_ELEC_WEIGHTER>>>(_data).data;
}
}));
@ -313,11 +317,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"计量秤实时接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log(_data);
Debug.Log("皮带秤实时数据:" + _data);
var _t_object = JsonConvert.DeserializeObject<DataBase<T>>(_data).data;
_callback?.Invoke(_t_object);
}
@ -355,11 +359,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"计量秤历史接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log(_data);
Debug.Log("计量秤历史数据:" + _data);
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
_callback?.Invoke(_t_object);
}
@ -380,10 +384,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"所有计量秤接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log("所有计量秤实时数据:" + _data);
m_OnRtBeltUpdate?.Invoke(_data);
}
}));
@ -402,10 +407,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"堆场最新库存接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log("堆场最新库存数据:" + _data);
m_OnYardLastUpdate?.Invoke(_data);
}
}));
@ -433,11 +439,11 @@ public class ApiManager : Singleton<ApiManager>
{
if (_error != null)
{
Debug.Log($"模糊查询接口错误:<color=#ff0000> {_error} </color>");
}
else
{
Debug.Log(_data);
Debug.Log("模糊查询数据:" + _data);
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
_callback?.Invoke(_t_object);
}