155 lines
3.8 KiB
C#
155 lines
3.8 KiB
C#
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
[System.Serializable]
|
|
public class DeviceInfor : MonoBehaviour
|
|
{
|
|
///// <summary>
|
|
///// 设备类型
|
|
///// </summary>
|
|
//[Header("设备类型")] public DeviceType devtype;
|
|
///// <summary>
|
|
///// 端口位置集
|
|
///// </summary>
|
|
//[Header("端口位置集")] public List<Transform> ports=new List<Transform>();
|
|
///// <summary>
|
|
///// 区域
|
|
///// </summary>
|
|
//[Header("区域")] public string area;
|
|
///// <summary>
|
|
///// 列
|
|
///// </summary>
|
|
//[Header("列")] public string row;
|
|
///// <summary>
|
|
///// 层
|
|
///// </summary>
|
|
//[Header("层")] public string tier;
|
|
|
|
///// <summary>
|
|
///// 当前设备所有端口线的信息
|
|
///// </summary>
|
|
//public List<List<string>> lineInfors;
|
|
|
|
public DeviceQuery deviceQuery;
|
|
|
|
public Text modelNum;
|
|
public Text type;
|
|
public Text deviceType;
|
|
public Text devicePosition;
|
|
public Text deviceName;
|
|
public Text deviceCode;
|
|
public Text status;
|
|
|
|
|
|
/// <summary>
|
|
/// 生产厂家
|
|
/// </summary>
|
|
public Text manufacturer;
|
|
/// <summary>
|
|
/// 负责人
|
|
/// </summary>
|
|
public Text directorName;
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public Text phone;
|
|
|
|
//public Text
|
|
|
|
public Button close_bt;
|
|
|
|
public void OnEnable()
|
|
{
|
|
clr();
|
|
deviceQuery = new DeviceQuery();
|
|
deviceQuery = GameManager.Inst.now_CK_Device.GetComponent<DeviceQuery>();
|
|
syncInfo();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
close_bt.onClick.AddListener(() =>
|
|
{
|
|
gameObject.SetActive(false);
|
|
GameManager.Inst.now_CK_Device = null;
|
|
if (CabinetUIManager.Instance.current_menu == Menu.M_数字机房_场景管理)
|
|
{
|
|
GameManager.Inst.objectToShow_add.SetActive(true);
|
|
GameManager.Inst.search_box.SetActive(true);
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
|
|
public void clr()
|
|
{
|
|
modelNum.text = null;
|
|
type.text = null;
|
|
deviceType.text = null;
|
|
devicePosition.text = null;
|
|
deviceName.text = null;
|
|
deviceCode.text = null;
|
|
status.text = null;
|
|
|
|
|
|
|
|
manufacturer.text = null;
|
|
|
|
directorName.text = null;
|
|
|
|
phone.text = null;
|
|
}
|
|
|
|
public void syncInfo()
|
|
{
|
|
modelNum.text = deviceQuery.deviceList.modelNum;
|
|
|
|
deviceType.text = deviceQuery.deviceList.deviceType;
|
|
|
|
if (deviceQuery.deviceList.type == "1")
|
|
type.text = "机柜";
|
|
else if (deviceQuery.deviceList.type == "2")
|
|
type.text = "设备";
|
|
else
|
|
type.text = null;
|
|
|
|
if (deviceQuery.deviceList.deviceType == "1")
|
|
deviceType.text = "机框";
|
|
else if (deviceQuery.deviceList.deviceType == "2")
|
|
deviceType.text = "机槽";
|
|
else if (deviceQuery.deviceList.deviceType == "3")
|
|
deviceType.text = "板卡";
|
|
else
|
|
deviceType.text = null;
|
|
|
|
devicePosition.text = deviceQuery.deviceList.devicePosition;
|
|
deviceName.text = deviceQuery.deviceList.deviceName;
|
|
deviceCode.text = deviceQuery.deviceList.deviceCode;
|
|
|
|
if (deviceQuery.deviceList.status == "1")
|
|
status.text = "正常";
|
|
else if (deviceQuery.deviceList.status == "0")
|
|
status.text = "禁用";
|
|
else
|
|
status.text = null;
|
|
|
|
manufacturer.text = deviceQuery.deviceList.manufacturer;
|
|
directorName.text = deviceQuery.deviceList.directorName;
|
|
phone.text = CombineJSON.Decrypt(deviceQuery.deviceList.phone);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 当前设备类型
|
|
/// </summary>
|
|
public enum DeviceType
|
|
{
|
|
dev1, dev2, dev3
|
|
}
|
|
|
|
public class Contact
|
|
{
|
|
public List<string> strings;
|
|
} |