|
@@ -254,10 +254,10 @@ public class GCJKLayer : YZTRootLayer
|
|
|
public Button taokouBtn;
|
|
|
|
|
|
private List<GongChengLieBiaoData> _DevivesDatas = new List<GongChengLieBiaoData>();
|
|
|
-
|
|
|
+
|
|
|
public GameObject _DeviceTrendPanelOri;
|
|
|
|
|
|
- private List<DeviceTrendPanel> openDeviceTrendPanelList = new List<DeviceTrendPanel>();
|
|
|
+ private Dictionary<string, DeviceTrendPanel> openDeviceTrendPanelList = new Dictionary<string, DeviceTrendPanel>();
|
|
|
//public GongChengLieBiaoItem currentSelectItem;
|
|
|
|
|
|
private void Awake()
|
|
@@ -288,20 +288,19 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
StaticLod.instance.OnFoucusStatic(0);
|
|
|
|
|
|
-
|
|
|
+
|
|
|
if (GlobalData.BuYuanShuiWeiDataList.Count < 1)
|
|
|
{
|
|
|
-
|
|
|
await HttpHelper._Instance.InitSWYJData();
|
|
|
}
|
|
|
+
|
|
|
if (GlobalData.BuYuanShuiYaDataList.Count < 1)
|
|
|
{
|
|
|
-
|
|
|
HttpHelper._Instance.GetBuYuanDevicesGroupInfo();
|
|
|
}
|
|
|
+
|
|
|
if (GlobalData.TaoKouShuiYaDataList.Count < 1)
|
|
|
{
|
|
|
-
|
|
|
HttpHelper._Instance.GetTaoKouDevicesGroupInfo();
|
|
|
}
|
|
|
|
|
@@ -589,6 +588,7 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
StaticLod.instance.OnFoucusStatic(type);
|
|
|
|
|
|
currentDataType = type;
|
|
@@ -605,6 +605,24 @@ public class GCJKLayer : YZTRootLayer
|
|
|
CreatWeiYiIcon();
|
|
|
FindWeiYiTargetObje();
|
|
|
|
|
|
+ //隐藏不是当前站点的监控
|
|
|
+ var currentObsType = currentDataType == 0 ? obsType.BuYuanObs : obsType.TaoKouObs;
|
|
|
+ if (_obsItems != null)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < _obsItems.Count; i++)
|
|
|
+ {
|
|
|
+ _obsItems[i].gameObject.SetActive(_obsItems[i]._data.type == currentObsType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_obsIconCtrls != null)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < _obsIconCtrls.Count; i++)
|
|
|
+ {
|
|
|
+ _obsIconCtrls[i].gameObject.SetActive(_obsIconCtrls[i]._data.type == currentObsType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
SetObsIconActive(obsToggle.isOn);
|
|
|
SetShuiWeiIconActive(false);
|
|
|
SetShuiYaIconActive(false);
|
|
@@ -620,40 +638,44 @@ public class GCJKLayer : YZTRootLayer
|
|
|
await HttpHelper._Instance.SendBuYuan_GetSensorData();
|
|
|
}
|
|
|
}
|
|
|
- else {
|
|
|
+ else
|
|
|
+ {
|
|
|
if (GlobalData.taoKouSensorData == null || GlobalData.taoKouSensorData.data.Count < 1)
|
|
|
{
|
|
|
await HttpHelper._Instance.SendTaoKou_GetSensorData();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
loading.gameObject.SetActive(false);
|
|
|
SetZhaZhanJianKongData();
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
|
|
|
public async void OpenDeviceTrendPanel(string _name, GongChengType _type, string _gid, string _sid)
|
|
|
{
|
|
|
- var tempTrendPanel= Instantiate(_DeviceTrendPanelOri, this.transform).GetComponent<DeviceTrendPanel>();
|
|
|
- tempTrendPanel.currentType = currentDataType;
|
|
|
- tempTrendPanel.InitDatePicker();
|
|
|
- await tempTrendPanel.Show(_name, _type, _gid, _sid);
|
|
|
- openDeviceTrendPanelList.Add(tempTrendPanel);
|
|
|
+ if (openDeviceTrendPanelList.ContainsKey(_name))
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var tempTrendPanel = Instantiate(_DeviceTrendPanelOri, this.transform).GetComponent<DeviceTrendPanel>();
|
|
|
+ tempTrendPanel.currentType = currentDataType;
|
|
|
+ tempTrendPanel.InitDatePicker();
|
|
|
+ await tempTrendPanel.Show(_name, _type, _gid, _sid);
|
|
|
+ openDeviceTrendPanelList.Add(_name, tempTrendPanel);
|
|
|
}
|
|
|
|
|
|
public void RemovePanel(DeviceTrendPanel panel)
|
|
|
{
|
|
|
- if (openDeviceTrendPanelList.Contains(panel))
|
|
|
+ if (openDeviceTrendPanelList.ContainsKey(panel.name))
|
|
|
{
|
|
|
- openDeviceTrendPanelList.Remove(panel);
|
|
|
+ openDeviceTrendPanelList.Remove(panel.name);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
private void OnDisable()
|
|
|
{
|
|
|
- for (int i = 0; i < openDeviceTrendPanelList.Count; i++)
|
|
|
+ foreach (var item in openDeviceTrendPanelList.Values)
|
|
|
{
|
|
|
- openDeviceTrendPanelList[i].Hide();
|
|
|
+ item.Hide();
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -698,7 +720,9 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
modelAniValues[i] = datas[i].openValue;
|
|
|
}
|
|
|
- ActionInstance._Instance.ModelAni_On?.Invoke( currentDataType == 0 ? AniType.buYuan : AniType.taoKou,modelAniValues);
|
|
|
+
|
|
|
+ ActionInstance._Instance.ModelAni_On?.Invoke(currentDataType == 0 ? AniType.buYuan : AniType.taoKou,
|
|
|
+ modelAniValues);
|
|
|
}
|
|
|
|
|
|
public void SetShuiWenJianCeData(ShuiWenJianCeData data)
|
|
@@ -732,7 +756,9 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
_DevivesDatas.Clear();
|
|
|
//水位
|
|
|
- foreach (var tempData in currentDataType==0?GlobalData.BuYuanShuiWeiDataList:GlobalData.TaoKouShuiWeiDataList)
|
|
|
+ foreach (var tempData in currentDataType == 0
|
|
|
+ ? GlobalData.BuYuanShuiWeiDataList
|
|
|
+ : GlobalData.TaoKouShuiWeiDataList)
|
|
|
{
|
|
|
GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
|
|
|
tempLieBiaoData.name = tempData.name;
|
|
@@ -744,7 +770,9 @@ public class GCJKLayer : YZTRootLayer
|
|
|
}
|
|
|
|
|
|
//水压
|
|
|
- foreach (var tempData in currentDataType==0?GlobalData.BuYuanShuiYaDataList:GlobalData.TaoKouShuiYaDataList)
|
|
|
+ foreach (var tempData in currentDataType == 0
|
|
|
+ ? GlobalData.BuYuanShuiYaDataList
|
|
|
+ : GlobalData.TaoKouShuiYaDataList)
|
|
|
{
|
|
|
GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
|
|
|
tempLieBiaoData.name = tempData.name;
|
|
@@ -756,7 +784,7 @@ public class GCJKLayer : YZTRootLayer
|
|
|
}
|
|
|
|
|
|
//位移
|
|
|
- foreach (var tempData in currentDataType==0?GlobalData.BuYuanWeiYiDataList:GlobalData.TaoKouWeiYiDataList)
|
|
|
+ foreach (var tempData in currentDataType == 0 ? GlobalData.BuYuanWeiYiDataList : GlobalData.TaoKouWeiYiDataList)
|
|
|
{
|
|
|
GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
|
|
|
tempLieBiaoData.name = tempData.name;
|
|
@@ -768,14 +796,14 @@ public class GCJKLayer : YZTRootLayer
|
|
|
}
|
|
|
|
|
|
//监控
|
|
|
- foreach (var tempData in currentDataType==0?GlobalData.obsDatas_by:GlobalData.obsDatas_tk)
|
|
|
+ foreach (var tempData in currentDataType == 0 ? GlobalData.obsDatas_by : GlobalData.obsDatas_tk)
|
|
|
{
|
|
|
GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
|
|
|
tempLieBiaoData.name = tempData.name;
|
|
|
tempLieBiaoData.type = GongChengType.shiPin;
|
|
|
tempLieBiaoData.state = tempData.status ? GongChengState.normal : GongChengState.warning;
|
|
|
tempLieBiaoData.sid = "";
|
|
|
- tempLieBiaoData.gid = "";//监控没有这玩意
|
|
|
+ tempLieBiaoData.gid = ""; //监控没有这玩意
|
|
|
_DevivesDatas.Add(tempLieBiaoData);
|
|
|
}
|
|
|
|
|
@@ -867,16 +895,22 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
Destroy(_obsItems[i].gameObject);
|
|
|
}
|
|
|
+
|
|
|
for (int i = 0; i < _obsIconCtrls.Count; i++)
|
|
|
{
|
|
|
Destroy(_obsIconCtrls[i].gameObject);
|
|
|
}
|
|
|
|
|
|
- for (int i = 0; i < GlobalData.layerUnitDatas.Count; i++) {
|
|
|
- if (GlobalData.layerUnitDatas[i].type == LayerUnitType.JK) {
|
|
|
- if (GlobalData.layerUnitDatas[i].text1 == "补元退洪闸") {
|
|
|
+ for (int i = 0; i < GlobalData.layerUnitDatas.Count; i++)
|
|
|
+ {
|
|
|
+ if (GlobalData.layerUnitDatas[i].type == LayerUnitType.JK)
|
|
|
+ {
|
|
|
+ if (GlobalData.layerUnitDatas[i].text1 == "补元退洪闸")
|
|
|
+ {
|
|
|
BYObsUseLib.Add(GlobalData.layerUnitDatas[i].namePri, false);
|
|
|
- } else if (GlobalData.layerUnitDatas[i].text1 == "套口进洪闸") {
|
|
|
+ }
|
|
|
+ else if (GlobalData.layerUnitDatas[i].text1 == "套口进洪闸")
|
|
|
+ {
|
|
|
TKObsUseLib.Add(GlobalData.layerUnitDatas[i].namePri, false);
|
|
|
}
|
|
|
}
|
|
@@ -884,9 +918,11 @@ public class GCJKLayer : YZTRootLayer
|
|
|
|
|
|
for (int i = 0; i < GlobalData.obsDatas_by.Count; i++)
|
|
|
{
|
|
|
- if (BYObsUseLib.ContainsKey(GlobalData.obsDatas_by[i].targetName)) {
|
|
|
+ if (BYObsUseLib.ContainsKey(GlobalData.obsDatas_by[i].targetName))
|
|
|
+ {
|
|
|
BYObsUseLib[GlobalData.obsDatas_by[i].targetName] = true;
|
|
|
}
|
|
|
+
|
|
|
//Debug.Log(GlobalData.obsDatas_by[i].name + ":000:" + GlobalData.obsDatas_by[i].targetName);
|
|
|
ObsItem tempItem = Instantiate(obsItemPrefab, obsItemContent).GetComponent<ObsItem>();
|
|
|
tempItem.SetData(GlobalData.obsDatas_by[i]);
|
|
@@ -903,8 +939,10 @@ public class GCJKLayer : YZTRootLayer
|
|
|
//Debug.Log(StaticLod.instance.GetStaticObj(GlobalData.obsDatas[i].name).gameObject.name);
|
|
|
}
|
|
|
|
|
|
- foreach (string keyName in BYObsUseLib.Keys) {
|
|
|
- if (!BYObsUseLib[keyName]) {
|
|
|
+ foreach (string keyName in BYObsUseLib.Keys)
|
|
|
+ {
|
|
|
+ if (!BYObsUseLib[keyName])
|
|
|
+ {
|
|
|
ObsIconCtrl tempIcon = Instantiate(obsIconPrefab, _obsIconContent).GetComponent<ObsIconCtrl>();
|
|
|
ObsData errorObs = new ObsData();
|
|
|
errorObs.name = keyName + "(丢失)";
|
|
@@ -922,6 +960,7 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
TKObsUseLib[GlobalData.obsDatas_tk[i].targetName] = true;
|
|
|
}
|
|
|
+
|
|
|
ObsItem tempItem = Instantiate(obsItemPrefab, obsItemContent).GetComponent<ObsItem>();
|
|
|
tempItem.SetData(GlobalData.obsDatas_tk[i]);
|
|
|
int tempi = i;
|
|
@@ -950,6 +989,26 @@ public class GCJKLayer : YZTRootLayer
|
|
|
_obsIconCtrls.Add(tempIcon);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //隐藏不是当前站点的监控
|
|
|
+ var currentObsType = currentDataType == 0 ? obsType.BuYuanObs : obsType.TaoKouObs;
|
|
|
+ if (_obsItems != null)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < _obsItems.Count; i++)
|
|
|
+ {
|
|
|
+ _obsItems[i].gameObject.SetActive(_obsItems[i]._data.type == currentObsType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (_obsIconCtrls != null)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < _obsIconCtrls.Count; i++)
|
|
|
+ {
|
|
|
+ _obsIconCtrls[i].gameObject.SetActive(_obsIconCtrls[i]._data.type == currentObsType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
SetObsIconActive(obsToggle.isOn);
|
|
|
}
|
|
|
|
|
@@ -1033,7 +1092,7 @@ public class GCJKLayer : YZTRootLayer
|
|
|
|
|
|
for (int i = 0; i < _obsIconCtrls.Count; i++)
|
|
|
{
|
|
|
- _obsIconCtrls[i].gameObject.SetActive(show);
|
|
|
+ _obsIconCtrls[i].gameObject.SetActive(_obsIconCtrls[i]._data.type == (obsType)currentDataType && show);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -1054,6 +1113,7 @@ public class GCJKLayer : YZTRootLayer
|
|
|
tempIcon.Init(DataList[i]);
|
|
|
_shuiWeiIconCtrls.Add(tempIcon);
|
|
|
}
|
|
|
+
|
|
|
Debug.Log(DataList.Count);
|
|
|
}
|
|
|
|
|
@@ -1158,6 +1218,7 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
Destroy(_weiYiIconCtrls[i].gameObject);
|
|
|
}
|
|
|
+
|
|
|
_weiYiIconCtrls = new List<WeiYiIconCtrl>();
|
|
|
var DataList = currentDataType == 0 ? GlobalData.BuYuanWeiYiDataList : GlobalData.TaoKouWeiYiDataList;
|
|
|
for (int i = 0; i < DataList.Count; i++)
|
|
@@ -1174,6 +1235,7 @@ public class GCJKLayer : YZTRootLayer
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
GameObject[] BY_targs = GameObject.FindGameObjectsWithTag(weiYiType.BuYuanWeiYi.ToString());
|
|
|
GameObject[] TK_targs = GameObject.FindGameObjectsWithTag(weiYiType.TaoKouWeiYi.ToString());
|
|
|
for (int i = 0; i < _weiYiIconCtrls.Count; i++)
|