浏览代码

修改补元硬件数据初始化的方法

Void_F 7 月之前
父节点
当前提交
0654b17ea8
共有 3 个文件被更改,包括 125 次插入323 次删除
  1. 110 309
      Assets/Scripts/HttpHelper.cs
  2. 1 1
      Assets/Scripts/UI/Item/ShuiWeiIconCtrl.cs
  3. 14 13
      Assets/Scripts/UI/UIView/GCJK/GCJKLayer.cs

+ 110 - 309
Assets/Scripts/HttpHelper.cs

@@ -351,9 +351,9 @@ public class HttpHelper : MonoBehaviour
     }
 
 
-    public async Task InitYZTData()
+    public async void InitYZTData()
     {
-        InitYZTData1(); //已完成迁移
+        await InitYZTData1(); //已完成迁移
         InitYZTData_BY_Obs(); //已完成迁移
         InitYZTData_TK_Obs(); //新增
         InitYZTData3(); //已完成迁移
@@ -836,7 +836,6 @@ public class HttpHelper : MonoBehaviour
 
     public async Task InitSWYJData1()
     {
-        GlobalData.BuYuanShuiWeiDataList = new List<ShuiWeiData>();
         var devicesInfo = _devicesIdDatas["上游水位计"];
         string sw1Result = await GetSingleDevicesInfo(2, devicesInfo.dataGid.ToString(), devicesInfo.dataSid.ToString(),
             "d", 10000);
@@ -845,14 +844,27 @@ public class HttpHelper : MonoBehaviour
             GetSingleDevicesRequest tempData = JsonConvert.DeserializeObject<GetSingleDevicesRequest>(sw1Result);
             if (tempData != null)
             {
-                GlobalData.BuYuanShuiWeiDataList.Add(new ShuiWeiData()
+                bool findData = false;
+                foreach (var VARIABLE in GlobalData.BuYuanShuiWeiDataList)
                 {
-                    name = "补元上游水位",
-                    targetName = "BY_ShuiWei_Up",
-                    value = float.Parse(tempData.data[0].avgS1),
-                    type = shuiWeiType.BuYuanShuiWei,
-                    datas = tempData.data.ToArray()
-                });
+                    if (VARIABLE.name.Equals("补元上游水位"))
+                    {
+                        VARIABLE.value = float.Parse(tempData.data[0].avgS1);
+                        VARIABLE.datas = tempData.data.ToArray();
+                        findData = true;
+                    }
+                }
+                if (!findData)
+                {
+                    GlobalData.BuYuanShuiWeiDataList.Add(new ShuiWeiData()
+                    {
+                        name = "补元上游水位",
+                        targetName = "BY_ShuiWei_Up",
+                        value = float.Parse(tempData.data[0].avgS1),
+                        type = shuiWeiType.BuYuanShuiWei,
+                        datas = tempData.data.ToArray()
+                    });
+                }
             }
         }
         catch (Exception e)
@@ -861,39 +873,52 @@ public class HttpHelper : MonoBehaviour
         }
 
         var devicesInfo1 = _devicesIdDatas["下游水位计"];
-        string sw2Result = await GetSingleDevicesInfo(2, devicesInfo.dataGid.ToString(), devicesInfo.dataSid.ToString(),
+        string sw2Result = await GetSingleDevicesInfo(2, devicesInfo1.dataGid.ToString(), devicesInfo1.dataSid.ToString(),
             "d", 100000);
         try
         {
             GetSingleDevicesRequest tempData = JsonConvert.DeserializeObject<GetSingleDevicesRequest>(sw2Result);
             if (tempData != null)
             {
-                GlobalData.BuYuanShuiWeiDataList.Add(new ShuiWeiData()
+                bool findData = false;
+                foreach (var VARIABLE in GlobalData.BuYuanShuiWeiDataList)
                 {
-                    name = "补元下游水位",
-                    targetName = "BY_ShuiWei_Down",
-                    value = float.Parse(tempData.data[0].avgS1),
-                    type = shuiWeiType.BuYuanShuiWei,
-                    datas = tempData.data.ToArray()
-                });
+                    if (VARIABLE.name.Equals("补元下游水位"))
+                    {
+                        VARIABLE.value = float.Parse(tempData.data[0].avgS1);
+                        VARIABLE.datas = tempData.data.ToArray();
+                        findData = true;
+                    }
+                }
+                if (!findData)
+                {
+                    GlobalData.BuYuanShuiWeiDataList.Add(new ShuiWeiData()
+                    {
+                        name = "补元下游水位",
+                        targetName = "BY_ShuiWei_Down",
+                        value = float.Parse(tempData.data[0].avgS1),
+                        type = shuiWeiType.BuYuanShuiWei,
+                        datas = tempData.data.ToArray()
+                    });
+                }
             }
         }
         catch (Exception e)
         {
             Debug.LogWarning("补元下游水位不成功,原因:" + e.ToString());
         }
-
-        string dayResult = await GetSingleDevicesInfo_day(devicesInfo.dataGid, devicesInfo.dataSid, 6);
+        string dayResult = await GetSingleDevicesInfo(2, devicesInfo.dataGid.ToString(), devicesInfo.dataSid.ToString(),
+            "d", 6);
         try
         {
-            GetDevicesRequestData tempData = JsonConvert.DeserializeObject<GetDevicesRequestData>(dayResult);
+            GetSingleDevicesRequest tempData = JsonConvert.DeserializeObject<GetSingleDevicesRequest>(dayResult);
             GlobalData.buYuanShuiWei_day = new ShuiWeiBianHuaData();
-            GlobalData.buYuanShuiWei_day.name = new string[6];
-            GlobalData.buYuanShuiWei_day.value = new double[6];
-            for (int i = 0; i < tempData.datas.Count; i++)
+            GlobalData.buYuanShuiWei_day.name = new string[tempData.data.Count];
+            GlobalData.buYuanShuiWei_day.value = new double[tempData.data.Count];
+            for (int i = 0; i < tempData.data.Count; i++)
             {
-                GlobalData.buYuanShuiWei_day.name[i] = tempData.datas[i].RecvTime;
-                GlobalData.buYuanShuiWei_day.value[i] = tempData.datas[i].NodeValue;
+                GlobalData.buYuanShuiWei_day.name[i] = tempData.data[i].timeGroup;
+                GlobalData.buYuanShuiWei_day.value[i] = double.Parse(tempData.data[i].avgS1);
             }
         }
         catch (Exception e)
@@ -901,17 +926,18 @@ public class HttpHelper : MonoBehaviour
             Debug.LogWarning("获取6天平均数据不成功,原因:" + e.ToString());
         }
 
-        string monthResult = await GetSingleDevicesInfo_month(devicesInfo.dataGid, devicesInfo.dataSid, 6);
+        string monthResult = await GetSingleDevicesInfo(2, devicesInfo.dataGid.ToString(), devicesInfo.dataSid.ToString(),
+            "d", 90);
         try
         {
-            GetDevicesRequestData tempData = JsonConvert.DeserializeObject<GetDevicesRequestData>(monthResult);
+            GetSingleDevicesRequest tempData = JsonConvert.DeserializeObject<GetSingleDevicesRequest>(monthResult);
             GlobalData.buYuanShuiWei_month = new ShuiWeiBianHuaData();
-            GlobalData.buYuanShuiWei_month.name = new string[6];
-            GlobalData.buYuanShuiWei_month.value = new double[6];
-            for (int i = 0; i < tempData.datas.Count; i++)
+            GlobalData.buYuanShuiWei_month.name = new string[tempData.data.Count];
+            GlobalData.buYuanShuiWei_month.value = new double[tempData.data.Count];
+            for (int i = 0; i < tempData.data.Count; i++)
             {
-                GlobalData.buYuanShuiWei_month.name[i] = tempData.datas[i].RecvTime;
-                GlobalData.buYuanShuiWei_month.value[i] = tempData.datas[i].NodeValue;
+                GlobalData.buYuanShuiWei_month.name[i] = tempData.data[i].timeGroup;
+                GlobalData.buYuanShuiWei_month.value[i] = double.Parse(tempData.data[i].avgS1);
             }
         }
         catch (Exception e)
@@ -919,17 +945,18 @@ public class HttpHelper : MonoBehaviour
             Debug.LogWarning("获取6月平均数据不成功,原因:" + e.ToString());
         }
 
-        string hourResult = await GetSingleDevicesInfo_hour(devicesInfo.dataGid, devicesInfo.dataSid, 6);
+        string hourResult = await GetSingleDevicesInfo(2, devicesInfo.dataGid.ToString(), devicesInfo.dataSid.ToString(),
+            "h", 6);
         try
         {
-            GetDevicesRequestData tempData = JsonConvert.DeserializeObject<GetDevicesRequestData>(hourResult);
+            GetSingleDevicesRequest tempData = JsonConvert.DeserializeObject<GetSingleDevicesRequest>(hourResult);
             GlobalData.buYuanShuiWei_hour = new ShuiWeiBianHuaData();
-            GlobalData.buYuanShuiWei_hour.name = new string[6];
-            GlobalData.buYuanShuiWei_hour.value = new double[6];
-            for (int i = 0; i < tempData.datas.Count; i++)
+            GlobalData.buYuanShuiWei_hour.name = new string[tempData.data.Count];
+            GlobalData.buYuanShuiWei_hour.value =  new double[tempData.data.Count];
+            for (int i = 0; i < tempData.data.Count; i++)
             {
-                GlobalData.buYuanShuiWei_hour.name[i] = tempData.datas[i].RecvTime;
-                GlobalData.buYuanShuiWei_hour.value[i] = tempData.datas[i].NodeValue;
+                GlobalData.buYuanShuiWei_hour.name[i] = tempData.data[i].timeGroup;
+                GlobalData.buYuanShuiWei_hour.value[i] = double.Parse(tempData.data[i].avgS1);
             }
         }
         catch (Exception e)
@@ -1055,7 +1082,7 @@ public class HttpHelper : MonoBehaviour
 
     public async void GetBuYuanDevicesGroupInfo()
     {
-        Debug.Log("获取所有渗压记");
+        Debug.Log("获取补元所有渗压记");
         //获取所有渗压记
         //GetDevicesData tempData = new GetDevicesData();
         //tempData.idsList = new List<DevicesMessage>();
@@ -1063,61 +1090,33 @@ public class HttpHelper : MonoBehaviour
         {
             if (device.stationName.Equals("补元") && device.sensorType.Equals("渗压计"))
             {
-                string syResult = await GetSingleDevicesInfo(2, device.dataGid.ToString(), device.dataSid.ToString(),
-                    "d", 1000);
-                Debug.Log("水压"+syResult);
-                try
-                {
-                    GetSingleDevicesRequest tempData = JsonConvert.DeserializeObject<GetSingleDevicesRequest>(syResult);
-                    if (tempData != null)
-                    {
-                        GlobalData.BuYuanShuiYaDataList.Add(new ShuiYaData()
-                        {
-                            name = device.sensorName,
-                            value = float.Parse(tempData.data[0].avgS1),
-                            type = shuiYaType.BuYuanShuiYa,
-                            targetName = $"BY_{device.sensorName}"
-                        });
-                    }
-                }
-                catch (Exception e)
+                GlobalData.BuYuanShuiYaDataList.Add(new ShuiYaData()
                 {
-                    Debug.LogWarning($"获取补元水压计设备{device.sensorName}数据不成功,原因:" + e.ToString());
-                    throw;
-                }
+                    name = device.sensorName,
+                    value = device.realtimeValue1,
+                    type = shuiYaType.BuYuanShuiYa,
+                    targetName = $"BY_{device.sensorName}"
+                });
             }
         }
-        Debug.Log("添加水压设备:"+ GlobalData.BuYuanShuiYaDataList.Count);
+        Debug.Log("添加补元渗压记:"+ GlobalData.BuYuanShuiYaDataList.Count);
         
+        Debug.Log("获取补元所有位移记");
         //获取所有位移记
         foreach (var device in _devicesIdDatas.Values)
         {
             if (device.stationName.Equals("补元") && device.sensorType.Equals("静力水准仪"))
             {
-                string wyResult = await GetSingleDevicesInfo(2, device.dataGid.ToString(), device.dataSid.ToString(),
-                    "d", 1000);
-                Debug.Log("位移"+wyResult);
-                try
+                GlobalData.BuYuanWeiYiDataList.Add(new WeiYiData()
                 {
-                    GetSingleDevicesRequest tempData = JsonConvert.DeserializeObject<GetSingleDevicesRequest>(wyResult);
-                    if (tempData != null)
-                    {
-                        GlobalData.BuYuanWeiYiDataList.Add(new WeiYiData()
-                        {
-                            name = device.sensorName,
-                            value = float.Parse(tempData.data[0].avgS1),
-                            type = weiYiType.BuYuanWeiYi,
-                            targetName = $"BY_{device.sensorName}"
-                        });
-                    }
-                }
-                catch (Exception e)
-                {
-                    Debug.LogWarning($"获取补元位移计设备{device.sensorName}数据不成功,原因:" + e.ToString());
-                    throw;
-                }
+                    name = device.sensorName,
+                    value =device.realtimeValue1,
+                    type = weiYiType.BuYuanWeiYi,
+                    targetName = $"BY_{device.sensorName}"
+                });
             }
         }
+        Debug.Log("添加补元位移记:"+ GlobalData.BuYuanWeiYiDataList.Count);
     }
 
     public async Task SendTaoKou_GetSensorData()
@@ -1546,231 +1545,33 @@ public class HttpHelper : MonoBehaviour
             Debug.Log($"读取本地初始化设备列表成功!!! count:{tempData.total}");
             www.Dispose();
         }
+        var devicesInfo = _devicesIdDatas["上游水位计"];
+        GlobalData.BuYuanShuiWeiDataList.Add(new ShuiWeiData()
+        {
+            name = "补元上游水位",
+            targetName = "BY_ShuiWei_Up",
+            value = devicesInfo.realtimeValue1,
+            type = shuiWeiType.BuYuanShuiWei,
+            datas = new []{new SingleDevicesRequestData()
+            {
+                avgS1 = devicesInfo.realtimeValue1.ToString(),
+                timeGroup = devicesInfo.dataUpdateTime
+            }}
+        });
+        var devicesInfo1 = _devicesIdDatas["下游水位计"];
+        GlobalData.BuYuanShuiWeiDataList.Add(new ShuiWeiData()
+        {
+            name = "补元下游水位",
+            targetName = "BY_ShuiWei_Down",
+            value = devicesInfo1.realtimeValue1,
+            type = shuiWeiType.BuYuanShuiWei,
+            datas = new []{new SingleDevicesRequestData()
+            {
+                avgS1 = devicesInfo1.realtimeValue1.ToString(),
+                timeGroup = devicesInfo1.dataUpdateTime
+            }}
+        });
     }
 
-    // /// <summary>
-    // /// 初始化所有补元硬件设备的获取信息
-    // /// </summary>
-    // public void InItBuYuanDevicesList()
-    // {
-    //     _devicesIdDatas = new Dictionary<string, DevicesId_Data>();
-    //
-    //     _devicesIdDatas.Add("上游水位计", new DevicesId_Data()
-    //     {
-    //         dataGid = 7,
-    //         dataSid = 4,
-    //         sensorName = "上游水位计",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("下游水位计", new DevicesId_Data()
-    //     {
-    //         dataGid = 8,
-    //         dataSid = 4,
-    //         sensorName = "上游水位计",
-    //         realtimeValue1 = -1
-    //     });
-    //
-    //     #region P
-    //
-    //     _devicesIdDatas.Add("P1", new DevicesId_Data()
-    //     {
-    //         dataGid = 1,
-    //         dataSid = 2,
-    //         sensorName = "P1/UP1",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P2", new DevicesId_Data()
-    //     {
-    //         dataGid = 2,
-    //         dataSid = 2,
-    //         sensorName = "P2/UP2",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P3", new DevicesId_Data()
-    //     {
-    //         dataGid = 3,
-    //         dataSid = 2,
-    //         sensorName = "P3",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P4", new DevicesId_Data()
-    //     {
-    //         dataGid = 4,
-    //         dataSid = 2,
-    //         sensorName = "P4/UP3",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P5", new DevicesId_Data()
-    //     {
-    //         dataGid = 1,
-    //         dataSid = 3,
-    //         sensorName = "P5/UP5",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P6", new DevicesId_Data()
-    //     {
-    //         dataGid = 2,
-    //         dataSid = 3,
-    //         sensorName = "P6/",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P7", new DevicesId_Data()
-    //     {
-    //         dataGid = 3,
-    //         dataSid = 3,
-    //         sensorName = "P7/UP5",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P8", new DevicesId_Data()
-    //     {
-    //         dataGid = 4,
-    //         dataSid = 3,
-    //         sensorName = "P8/UP6",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P5温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 9,
-    //         dataSid = 3,
-    //         sensorName = "P5温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P6温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 10,
-    //         dataSid = 3,
-    //         sensorName = "P6温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P7温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 11,
-    //         dataSid = 3,
-    //         sensorName = "P7温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P8温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 12,
-    //         dataSid = 3,
-    //         sensorName = "P8温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P9温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 9,
-    //         dataSid = 4,
-    //         sensorName = "P9温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P10温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 10,
-    //         dataSid = 4,
-    //         sensorName = "P10温度",
-    //         realtimeValue1 = -1
-    //     });
-    //
-    //     _devicesIdDatas.Add("P12温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 11,
-    //         dataSid = 4,
-    //         sensorName = "P12温度",
-    //         realtimeValue1 = -1
-    //     });
-    //
-    //     _devicesIdDatas.Add("P9", new DevicesId_Data()
-    //     {
-    //         dataGid = 3,
-    //         dataSid = 4,
-    //         sensorName = "P9",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P10", new DevicesId_Data()
-    //     {
-    //         dataGid = 4,
-    //         dataSid = 4,
-    //         sensorName = "P10/UP7",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P11", new DevicesId_Data()
-    //     {
-    //         dataGid = 5,
-    //         dataSid = 4,
-    //         sensorName = "P11/UP8",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add("P12", new DevicesId_Data()
-    //     {
-    //         dataGid = 1,
-    //         dataSid = 4,
-    //         sensorName = "P12/UP9",
-    //         realtimeValue1 = -1
-    //     });
-    //
-    //     _devicesIdDatas.Add("P13", new DevicesId_Data()
-    //     {
-    //         dataGid = 2,
-    //         dataSid = 4,
-    //         sensorName = "P13/UP10",
-    //         realtimeValue1 = -1
-    //     });
-    //
-    //     #endregion
-    //
-    //     #region M
-    //
-    //     //M1-8
-    //     int m_cid = 1;
-    //     int m_did = 5;
-    //     for (int i = 0; i < 8; i++)
-    //     {
-    //         _devicesIdDatas.Add($"M{i + 1}", new DevicesId_Data()
-    //         {
-    //             dataGid = m_cid + i,
-    //             dataSid = m_did,
-    //             sensorName = $"M{i + 1}",
-    //             realtimeValue1 = -1
-    //         });
-    //     }
-    //
-    //     //M温度
-    //     _devicesIdDatas.Add($"M2温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 10,
-    //         dataSid = 5,
-    //         sensorName = $"M2温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add($"M5温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 13,
-    //         dataSid = 5,
-    //         sensorName = $"M5温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add($"M6温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 14,
-    //         dataSid = 5,
-    //         sensorName = $"M6温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add($"M7温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 15,
-    //         dataSid = 5,
-    //         sensorName = $"M7温度",
-    //         realtimeValue1 = -1
-    //     });
-    //     _devicesIdDatas.Add($"M8温度", new DevicesId_Data()
-    //     {
-    //         dataGid = 16,
-    //         dataSid = 5,
-    //         sensorName = $"M8温度",
-    //         realtimeValue1 = -1
-    //     });
-    //
-    //     #endregion
-    // }
+   
 }

+ 1 - 1
Assets/Scripts/UI/Item/ShuiWeiIconCtrl.cs

@@ -23,7 +23,7 @@ public class ShuiWeiIconCtrl : MonoBehaviour
         rect.anchoredPosition = new Vector2(2000, 0);
         
         valueText = this.transform.Find("valueText").GetComponent<Text>();
-        valueText.text = $"{data.value} <size=12><color=FFFFFF>m</color></size>";
+        valueText.text = $"{data.value} <size=12><color=FFFFFF>mm</color></size>";
         histroyButton = this.transform.Find("histroyButton").GetComponent<Button>();
         histroyButton.onClick.RemoveAllListeners();
         histroyButton.onClick.AddListener(() =>

+ 14 - 13
Assets/Scripts/UI/UIView/GCJK/GCJKLayer.cs

@@ -807,33 +807,34 @@ public class GCJKLayer : YZTRootLayer
     }
 
     //监控列表
-    public async Task CreatObsItem()
+    public async void CreatObsItem()
     {
         await new WaitUntil(() => { return GlobalData.obsDatas_by.Count > 0&& GlobalData.obsDatas_tk.Count>0; });
         _obsItems = new List<ObsItem>();
         _obsIconCtrls = new List<ObsIconCtrl>();
-        
+        //Debug.Log("监控列表数量:"+GlobalData.obsDatas_by.Count);
         for (int i = 0; i < GlobalData.obsDatas_by.Count; i++)
         {
             ObsItem tempItem = Instantiate(obsItemPrefab, obsItemContent).GetComponent<ObsItem>();
             tempItem.SetData(GlobalData.obsDatas_by[i]);
             _obsItems.Add(tempItem);
             ObsIconCtrl tempIcon = Instantiate(obsIconPrefab, _obsIconContent).GetComponent<ObsIconCtrl>();
+            Debug.Log(GlobalData.obsDatas_by[i].name +" "+GlobalData.obsDatas_by[i].targetName);
             tempIcon.Init(GlobalData.obsDatas_by[i]);
             _obsIconCtrls.Add(tempIcon);
             //Debug.Log(StaticLod.instance.GetStaticObj(GlobalData.obsDatas[i].name).gameObject.name);
         }
-        
-        for (int i = 0; i < GlobalData.obsDatas_tk.Count; i++)
-        {
-            ObsItem tempItem = Instantiate(obsItemPrefab, obsItemContent).GetComponent<ObsItem>();
-            tempItem.SetData(GlobalData.obsDatas_tk[i]);
-            _obsItems.Add(tempItem);
-            ObsIconCtrl tempIcon = Instantiate(obsIconPrefab, _obsIconContent).GetComponent<ObsIconCtrl>();
-            tempIcon.Init(GlobalData.obsDatas_tk[i]);
-            _obsIconCtrls.Add(tempIcon);
-            //Debug.Log(StaticLod.instance.GetStaticObj(GlobalData.obsDatas[i].name).gameObject.name);
-        }
+        //Debug.Log($"创建补元监控对象:{_obsItems.Count} {_obsIconCtrls.Count} {GlobalData.obsDatas_by.Count} {GlobalData.obsDatas_tk.Count}");
+        // for (int i = 0; i < GlobalData.obsDatas_tk.Count; i++)
+        // {
+        //     ObsItem tempItem = Instantiate(obsItemPrefab, obsItemContent).GetComponent<ObsItem>();
+        //     tempItem.SetData(GlobalData.obsDatas_tk[i]);
+        //     _obsItems.Add(tempItem);
+        //     ObsIconCtrl tempIcon = Instantiate(obsIconPrefab, _obsIconContent).GetComponent<ObsIconCtrl>();
+        //     tempIcon.Init(GlobalData.obsDatas_tk[i]);
+        //     _obsIconCtrls.Add(tempIcon);
+        //     //Debug.Log(StaticLod.instance.GetStaticObj(GlobalData.obsDatas[i].name).gameObject.name);
+        // }
 
         SetObsIconActive(obsToggle.isOn);
     }