parent
52bac73a8a
commit
19e8b74416
|
@ -66,7 +66,7 @@ MonoBehaviour:
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_text: New Text
|
m_text: "\u672A\u77E5\u8BA1\u91CF\u8BBE\u5907"
|
||||||
m_isRightToLeft: 0
|
m_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 39d48bca937920746ae0cfa602467f63, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: 39d48bca937920746ae0cfa602467f63, type: 2}
|
||||||
m_sharedMaterial: {fileID: 3298889249665915115, guid: 39d48bca937920746ae0cfa602467f63,
|
m_sharedMaterial: {fileID: 3298889249665915115, guid: 39d48bca937920746ae0cfa602467f63,
|
||||||
|
|
|
@ -66,7 +66,7 @@ MonoBehaviour:
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
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_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 39d48bca937920746ae0cfa602467f63, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: 39d48bca937920746ae0cfa602467f63, type: 2}
|
||||||
m_sharedMaterial: {fileID: 3298889249665915115, guid: 39d48bca937920746ae0cfa602467f63,
|
m_sharedMaterial: {fileID: 3298889249665915115, guid: 39d48bca937920746ae0cfa602467f63,
|
||||||
|
|
|
@ -282,7 +282,7 @@ MonoBehaviour:
|
||||||
m_OnCullStateChanged:
|
m_OnCullStateChanged:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls: []
|
m_Calls: []
|
||||||
m_text: "\u7801\u5934XX\u4E00\u53F7\u6CCA\u4F4D"
|
m_text: "\u672A\u77E5\u76F8\u673A"
|
||||||
m_isRightToLeft: 0
|
m_isRightToLeft: 0
|
||||||
m_fontAsset: {fileID: 11400000, guid: 7189cdc95f54eb84ba6a7b8655aebb40, type: 2}
|
m_fontAsset: {fileID: 11400000, guid: 7189cdc95f54eb84ba6a7b8655aebb40, type: 2}
|
||||||
m_sharedMaterial: {fileID: 1594732787684875815, guid: 7189cdc95f54eb84ba6a7b8655aebb40,
|
m_sharedMaterial: {fileID: 1594732787684875815, guid: 7189cdc95f54eb84ba6a7b8655aebb40,
|
||||||
|
|
|
@ -12,7 +12,7 @@ public class Configure
|
||||||
{
|
{
|
||||||
public string MONITOR_ID { get; set; }
|
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>
|
public class ApiManager : Singleton<ApiManager>
|
||||||
|
@ -75,7 +75,6 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
base.Awake();
|
base.Awake();
|
||||||
|
|
||||||
|
|
||||||
//var _ip_str_url = Path.Combine(Application.streamingAssetsPath, "configure.json");
|
//var _ip_str_url = Path.Combine(Application.streamingAssetsPath, "configure.json");
|
||||||
//StartCoroutine(RequestBase.Get(_ip_str_url, (_data, _error) =>
|
//StartCoroutine(RequestBase.Get(_ip_str_url, (_data, _error) =>
|
||||||
//{
|
//{
|
||||||
|
@ -107,7 +106,7 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
Debug.Log($"本地api配置错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -119,9 +118,9 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
var _cam_dic_url = Path.Combine(Application.streamingAssetsPath, "configure_camera.json");
|
var _cam_dic_url = Path.Combine(Application.streamingAssetsPath, "configure_camera.json");
|
||||||
StartCoroutine(RequestBase.Get(_cam_dic_url, (_data, _error) =>
|
StartCoroutine(RequestBase.Get(_cam_dic_url, (_data, _error) =>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
Debug.Log($"本地camera配置错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -141,7 +140,7 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
Debug.Log($"本地yard配置错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -176,6 +175,7 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerator GetCameraList()
|
IEnumerator GetCameraList()
|
||||||
{
|
{
|
||||||
|
Debug.Log("相机接口等待执行");
|
||||||
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
|
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
|
||||||
var _get_camera_list = IpAddress + ApiDic["GetCameraList"];
|
var _get_camera_list = IpAddress + ApiDic["GetCameraList"];
|
||||||
|
|
||||||
|
@ -193,10 +193,11 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
Debug.Log($"相机接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Debug.Log($"相机数据:{_data}");
|
||||||
T_BAS_CAMERA_List = JsonConvert.DeserializeObject<DataBase<List<T_BAS_CAMERA>>>(_data).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>
|
/// <returns></returns>
|
||||||
IEnumerator GetYardInformation()
|
IEnumerator GetYardInformation()
|
||||||
{
|
{
|
||||||
|
Debug.Log("堆场接口等待执行");
|
||||||
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
|
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
|
||||||
var _get_yard_information = IpAddress + ApiDic["GetYardList"];
|
var _get_yard_information = IpAddress + ApiDic["GetYardList"];
|
||||||
|
|
||||||
|
@ -228,10 +230,11 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
Debug.Log($"堆场接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Debug.Log($"堆场数据:{_data}");
|
||||||
T_BAS_YARD_List = JsonConvert.DeserializeObject<DataBase<List<T_BAS_YARD>>>(_data).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)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"堆场库存信息接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Log(_data);
|
Debug.Log("堆场库存信息数据:" + _data);
|
||||||
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
|
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
|
||||||
_callback?.Invoke(_t_object);
|
_callback?.Invoke(_t_object);
|
||||||
}
|
}
|
||||||
|
@ -270,9 +273,9 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
IEnumerator GetBeltScale()
|
IEnumerator GetBeltScale()
|
||||||
{
|
{
|
||||||
|
Debug.Log("计量秤接口等待执行");
|
||||||
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
|
yield return new WaitUntil(() => { return !string.IsNullOrEmpty(IpAddress) && ApiDic.Count > 0; });
|
||||||
var _get_belt_scale = IpAddress + ApiDic["GetWeighterList"];
|
var _get_belt_scale = IpAddress + ApiDic["GetWeighterList"];
|
||||||
|
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (CallForTest.instance != null)
|
if (CallForTest.instance != null)
|
||||||
{
|
{
|
||||||
|
@ -288,10 +291,11 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
Debug.Log($"<color=#ff0000> {_error} </color>");
|
Debug.Log($"计量秤接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Debug.Log($"皮带秤数据:{_data}");
|
||||||
T_BAS_ELEC_WEIGHTER_List = JsonConvert.DeserializeObject<DataBase<List<T_BAS_ELEC_WEIGHTER>>>(_data).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)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"计量秤实时接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Log(_data);
|
Debug.Log("皮带秤实时数据:" + _data);
|
||||||
var _t_object = JsonConvert.DeserializeObject<DataBase<T>>(_data).data;
|
var _t_object = JsonConvert.DeserializeObject<DataBase<T>>(_data).data;
|
||||||
_callback?.Invoke(_t_object);
|
_callback?.Invoke(_t_object);
|
||||||
}
|
}
|
||||||
|
@ -355,11 +359,11 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"计量秤历史接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Log(_data);
|
Debug.Log("计量秤历史数据:" + _data);
|
||||||
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
|
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
|
||||||
_callback?.Invoke(_t_object);
|
_callback?.Invoke(_t_object);
|
||||||
}
|
}
|
||||||
|
@ -380,10 +384,11 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"所有计量秤接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Debug.Log("所有计量秤实时数据:" + _data);
|
||||||
m_OnRtBeltUpdate?.Invoke(_data);
|
m_OnRtBeltUpdate?.Invoke(_data);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -402,10 +407,11 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"堆场最新库存接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Debug.Log("堆场最新库存数据:" + _data);
|
||||||
m_OnYardLastUpdate?.Invoke(_data);
|
m_OnYardLastUpdate?.Invoke(_data);
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
@ -433,11 +439,11 @@ public class ApiManager : Singleton<ApiManager>
|
||||||
{
|
{
|
||||||
if (_error != null)
|
if (_error != null)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"模糊查询接口错误:<color=#ff0000> {_error} </color>");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Debug.Log(_data);
|
Debug.Log("模糊查询数据:" + _data);
|
||||||
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
|
var _t_object = JsonConvert.DeserializeObject<DataBase<List<T>>>(_data).data;
|
||||||
_callback?.Invoke(_t_object);
|
_callback?.Invoke(_t_object);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue