①端口新增、配置界面打开初始化对联机柜

②线缆展示返回后线缆依旧存在不复原
③将搜索框展示线缆组方法封装
This commit is contained in:
高国正 2023-10-19 18:09:39 +08:00
parent 981bea17ce
commit 594c04a662
8 changed files with 199 additions and 90 deletions

Binary file not shown.

View File

@ -32882,7 +32882,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!114 &972472143
MonoBehaviour:
m_ObjectHideFlags: 0
@ -35581,7 +35581,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!114 &1062479493
MonoBehaviour:
m_ObjectHideFlags: 0
@ -40055,7 +40055,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!114 &1185399851
MonoBehaviour:
m_ObjectHideFlags: 0
@ -48392,7 +48392,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!114 &1451505365
MonoBehaviour:
m_ObjectHideFlags: 0
@ -49950,7 +49950,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!114 &1492239479
MonoBehaviour:
m_ObjectHideFlags: 0
@ -49972,7 +49972,7 @@ MonoBehaviour:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10917, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
@ -61742,7 +61742,7 @@ MonoBehaviour:
xllx_cx:
cdqx_cx:
arguments:
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTc2ODQ3MzMsInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.ZcV0SDVyD6sswQFUdkDs9i1ZG9DGq0vZbPpkZbK_Rkc
token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2OTc3NjQ5MzgsInVzZXJuYW1lIjoiMTgzMTIzNDU2NzgifQ.TWEi6YYj04FNDxlrQnqd7CqHBYfnim0nH9zj4wHidbo
heatThresholdValueMax:
heatThresholdValueMin:
humidityThresholdValueMax:
@ -116359,7 +116359,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!222 &2126159577001144463
CanvasRenderer:
m_ObjectHideFlags: 0
@ -131565,7 +131565,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!222 &4362348815754620643
CanvasRenderer:
m_ObjectHideFlags: 0
@ -133081,7 +133081,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!224 &4362348815828793253
RectTransform:
m_ObjectHideFlags: 0
@ -144913,7 +144913,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!222 &4362348816371746285
CanvasRenderer:
m_ObjectHideFlags: 0
@ -149738,7 +149738,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!224 &4362348816565462283
RectTransform:
m_ObjectHideFlags: 0
@ -165984,7 +165984,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ShowMaskGraphic: 0
m_ShowMaskGraphic: 1
--- !u!224 &4362348817291697805
RectTransform:
m_ObjectHideFlags: 0

View File

@ -172,7 +172,7 @@ public class SearchName : MonoBehaviour
}
[HideInInspector] public int co = -1;
/// <summary>
/// 添加列表点击方法
/// </summary>
@ -181,7 +181,7 @@ public class SearchName : MonoBehaviour
int childCount = SearchObjects.Count;
for (int i = 0; i < childCount; i++)
{
int co = i;
co = i;
int eventCount = scrollViewContent.GetChild(i).GetComponent<Button>().onClick.GetPersistentEventCount();
if (eventCount > 0)
@ -240,84 +240,86 @@ public class SearchName : MonoBehaviour
//transparentGlows.Add(A.GetComponent<TransparentGlow>());
//transparentGlows.Add(B.GetComponent<TransparentGlow>());
List<TransparentGlow> transparentGlows = new List<TransparentGlow>();
#region
//List<TransparentGlow> transparentGlows = new List<TransparentGlow>();
var s = PatternChoose.Inst.xianlan.gameObject.GetComponentsInChildren<LineInfor>(true);
Array.ForEach(s, (item) =>
{
if (item.cableGroupName == objs_str[co])
{
if (ExtendedFlycam.Room. != ExtendedFlycam.Inst.room)
{
for (int i = 0; i < GameManager.Inst.Cabinets_go.Count; i++)
{
GameManager.Inst.Cabinets_go[i].GetComponent<TransparentGlow>().F1();
}
;
GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
transparentGlows.Add(go1.GetComponent<TransparentGlow>());
transparentGlows.Add(go2.GetComponent<TransparentGlow>());
item.gameObject.SetActive(true);
}
else
{
PatternChoose.Inst.quanJing_fuc();
for (int i = 0; i < GameManager.Inst.Cabinets_go.Count; i++)
{
GameManager.Inst.Cabinets_go[i].GetComponent<TransparentGlow>().F1();
}
GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
transparentGlows.Add(go1.GetComponent<TransparentGlow>());
transparentGlows.Add(go2.GetComponent<TransparentGlow>());
item.gameObject.SetActive(true);
}
}
else if (dic_notContain.ContainsKey(objs_str[co]))
{
//弹出提示——该线缆组不包含线缆
SecondConfirmPanel.DeleteConform(null, "该线缆组不包含线缆");
//关闭多余线缆机柜
item.gameObject.SetActive(false);
}
else
{
item.gameObject.SetActive(false);
}
});
//var s = PatternChoose.Inst.xianlan.gameObject.GetComponentsInChildren<LineInfor>(true);
//Array.ForEach(s, (item) =>
//{
// if (item.cableGroupName == objs_str[co])
// {
// if (ExtendedFlycam.Room.配电室 != ExtendedFlycam.Inst.room)
// {
// for (int i = 0; i < GameManager.Inst.Cabinets_go.Count; i++)
// {
// GameManager.Inst.Cabinets_go[i].GetComponent<TransparentGlow>().F1();
// }
// ;
// GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
// GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
// transparentGlows.Add(go1.GetComponent<TransparentGlow>());
// transparentGlows.Add(go2.GetComponent<TransparentGlow>());
// item.gameObject.SetActive(true);
// }
// else
// {
// PatternChoose.Inst.quanJing_fuc();
// for (int i = 0; i < GameManager.Inst.Cabinets_go.Count; i++)
// {
// GameManager.Inst.Cabinets_go[i].GetComponent<TransparentGlow>().F1();
// }
// GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
// GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
// transparentGlows.Add(go1.GetComponent<TransparentGlow>());
// transparentGlows.Add(go2.GetComponent<TransparentGlow>());
// item.gameObject.SetActive(true);
// }
// }
// else if (dic_notContain.ContainsKey(objs_str[co]))
// {
// //弹出提示——该线缆组不包含线缆
// SecondConfirmPanel.DeleteConform(null, "该线缆组不包含线缆");
// //关闭多余线缆机柜
// item.gameObject.SetActive(false);
// }
// else
// {
// item.gameObject.SetActive(false);
// }
//});
for (int i = 0; i < PatternChoose.Inst.xianlan.transform.childCount; i++)
{
if (PatternChoose.Inst.xianlan.transform.GetChild(i).name == objs_str[co])
{
var _CAB = PatternChoose.Inst.xianlan.transform.GetChild(i).GetComponentsInChildren<LineInfor>(true);
foreach (var item in _CAB)
{
GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
transparentGlows.Add(go1.GetComponent<TransparentGlow>());
transparentGlows.Add(go2.GetComponent<TransparentGlow>());
}
PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(true);
}
else if (dic_notContain.ContainsKey(objs_str[co]))
{
//弹出提示——该线缆组不包含线缆
SecondConfirmPanel.DeleteConform(null, "该线缆组不包含线缆");
//关闭多余线缆机柜
PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(false);
}
else
{
PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(false);
}
}
//for (int i = 0; i < PatternChoose.Inst.xianlan.transform.childCount; i++)
//{
// if (PatternChoose.Inst.xianlan.transform.GetChild(i).name == objs_str[co])
// {
// var _CAB = PatternChoose.Inst.xianlan.transform.GetChild(i).GetComponentsInChildren<LineInfor>(true);
// foreach (var item in _CAB)
// {
// GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
// GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
// transparentGlows.Add(go1.GetComponent<TransparentGlow>());
// transparentGlows.Add(go2.GetComponent<TransparentGlow>());
// }
// PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(true);
// }
// else if (dic_notContain.ContainsKey(objs_str[co]))
// {
// //弹出提示——该线缆组不包含线缆
// SecondConfirmPanel.DeleteConform(null, "该线缆组不包含线缆");
// //关闭多余线缆机柜
// PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(false);
// }
// else
// {
// PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(false);
// }
//}
TransparentGlowManage.Inst.renewALL(transparentGlows.ToArray());
//TransparentGlowManage.Inst.renewALL(transparentGlows.ToArray());
#endregion
showXianLan(co);
});
}
break;
@ -329,6 +331,90 @@ public class SearchName : MonoBehaviour
}
}
/// <summary>
/// 展示线缆组
/// </summary>
/// <param name="co"></param>
public void showXianLan(int co)
{
List<TransparentGlow> transparentGlows = new List<TransparentGlow>();
var s = PatternChoose.Inst.xianlan.gameObject.GetComponentsInChildren<LineInfor>(true);
Array.ForEach(s, (item) =>
{
if (item.cableGroupName == objs_str[co])
{
if (ExtendedFlycam.Room. != ExtendedFlycam.Inst.room)
{
for (int i = 0; i < GameManager.Inst.Cabinets_go.Count; i++)
{
GameManager.Inst.Cabinets_go[i].GetComponent<TransparentGlow>().F1();
}
;
GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
transparentGlows.Add(go1.GetComponent<TransparentGlow>());
transparentGlows.Add(go2.GetComponent<TransparentGlow>());
item.gameObject.SetActive(true);
}
else
{
PatternChoose.Inst.quanJing_fuc();
for (int i = 0; i < GameManager.Inst.Cabinets_go.Count; i++)
{
GameManager.Inst.Cabinets_go[i].GetComponent<TransparentGlow>().F1();
}
GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
transparentGlows.Add(go1.GetComponent<TransparentGlow>());
transparentGlows.Add(go2.GetComponent<TransparentGlow>());
item.gameObject.SetActive(true);
}
}
else if (dic_notContain.ContainsKey(objs_str[co]))
{
//弹出提示——该线缆组不包含线缆
SecondConfirmPanel.DeleteConform(null, "该线缆组不包含线缆");
//关闭多余线缆机柜
item.gameObject.SetActive(false);
}
else
{
item.gameObject.SetActive(false);
}
});
for (int i = 0; i < PatternChoose.Inst.xianlan.transform.childCount; i++)
{
if (PatternChoose.Inst.xianlan.transform.GetChild(i).name == objs_str[co])
{
var _CAB = PatternChoose.Inst.xianlan.transform.GetChild(i).GetComponentsInChildren<LineInfor>(true);
foreach (var item in _CAB)
{
GameObject go1 = GameManager.Inst.FindParent(item.lines[0].gameObject, GameManager.Inst.IsDesiredParent);
GameObject go2 = GameManager.Inst.FindParent(item.lines[1].gameObject, GameManager.Inst.IsDesiredParent);
transparentGlows.Add(go1.GetComponent<TransparentGlow>());
transparentGlows.Add(go2.GetComponent<TransparentGlow>());
}
PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(true);
}
else if (dic_notContain.ContainsKey(objs_str[co]))
{
//弹出提示——该线缆组不包含线缆
SecondConfirmPanel.DeleteConform(null, "该线缆组不包含线缆");
//关闭多余线缆机柜
PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(false);
}
else
{
PatternChoose.Inst.xianlan.transform.GetChild(i).gameObject.SetActive(false);
}
}
TransparentGlowManage.Inst.renewALL(transparentGlows.ToArray());
}
Predicate<Transform> findCabinet = (Transform go) =>
{
//端口-设备 go.parent

View File

@ -106,9 +106,14 @@ public class PatternChoose : MonoBehaviour
niaoKan_fuc();
});
back_page.onClick.AddListener(()=>
back_page.onClick.AddListener(() =>
{
quanJing_fuc();
if (Menu.M_数字孪生_线缆连接_展示 == CabinetUIManager.Instance.current_menu)
{
SearchName searchName = search_go.GetComponent<SearchName>();
searchName.showXianLan(searchName.co);
}
});
//Debug.Log("版本号 1.1.1");
@ -201,7 +206,7 @@ public class PatternChoose : MonoBehaviour
// Update is called once per frame
void Update()
{
if (GameManager.Inst.magnifyState)
if (GameManager.Inst.magnifyState)
{
back_page.gameObject.SetActive(true);
}

View File

@ -109,6 +109,7 @@ public class AddPort : MonoBehaviour
}
init();
findIndex(conCabinet, "");
port.text = null;
portCode.text = null;
@ -296,6 +297,22 @@ public class AddPort : MonoBehaviour
}
}
/// <summary>
/// 寻找下拉菜单选项
/// </summary>
/// <param name="_dro"></param>
/// <param name="_name"></param>
public string findIndex(Dropdown _dro, string _name)
{
int index = _dro.options.FindIndex(x => x.text == _name);
if (index != -1)
{
_dro.captionText.text = _dro.options[index].text;
_dro.value = index;
return index.ToString();
}
return null;
}
private IEnumerator SaveJsonCoroutine()
{

View File

@ -151,6 +151,7 @@ public class RedactPort : MonoBehaviour
portCode.text = mybody.portCode;
portName.text = mybody.portName;
//cableGroupName.captionText.text = mybody.cableGroupName;
findIndex(conCabinet, conCabinet_name);
findIndex(cableGroupName, mybody.cableGroupName);
cableName.text = mybody.cableName;
//deviceId.text = mybody.deviceId;