Browse Source

工程监控,设备列表修改

Void_F 1 day ago
parent
commit
4123c1211e

+ 41 - 0
Assets/Editor/DevicesTargetCreat.cs

@@ -0,0 +1,41 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using UnityEngine;
+using UnityEditor;
+using Object = UnityEngine.Object;
+
+public class DevicesTargetCreat : EditorWindow
+{
+    public Transform creatContent;
+    public Object jsonFile;
+    public Vector3 creatPos;
+    [MenuItem("Plugins/DevicesTargetCreat")]
+    static void Init()
+    {
+        DevicesTargetCreat DevicesTargetCreatTool = EditorWindow.CreateWindow<DevicesTargetCreat>();
+        DevicesTargetCreatTool.Show();
+    }
+
+    public void OnGUI()
+    {
+        creatPos=EditorGUILayout.Vector3Field("生成坐标", creatPos);
+        jsonFile = Selection.activeObject;
+        if (GUILayout.Button("生成参照物"))
+        {
+            if (jsonFile == null)
+            {
+                Debug.LogError("没选择Json!");
+                return;
+            }
+
+            int tempCount = 0;
+            int abIndex = 0;
+            string path = AssetDatabase.GetAssetPath(jsonFile);
+            
+
+        }
+    }
+}

+ 11 - 0
Assets/Editor/DevicesTargetCreat.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 6b778234b9850f247b3de34bc7aced93
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

File diff suppressed because it is too large
+ 274 - 382
Assets/Prefabs/UI/XHYZT/GCJK.prefab


File diff suppressed because it is too large
+ 5 - 529
Assets/Scene 1.unity


+ 13 - 65
Assets/Scripts/HttpHelper.cs

@@ -23,7 +23,6 @@ public class HttpHelper : MonoBehaviour
 
     public static HttpHelper _Instance;
 
-    public static Dictionary<string, DevicesId_Data> _devicesIdDatas = new Dictionary<string, DevicesId_Data>();
 
     public const int timeOut = 3;
 
@@ -70,7 +69,7 @@ public class HttpHelper : MonoBehaviour
             InitYZTData();
         }
 
-        if (_devicesIdDatas.Count < 1)
+        if (GlobalData._devicesIdDatas.Count < 1)
         {
             await GetSensorList();
         }
@@ -1171,7 +1170,7 @@ public class HttpHelper : MonoBehaviour
     /// <returns></returns>
     public async Task InitSWYJData1()
     {
-        var devicesInfo = _devicesIdDatas["上游水位计"];
+        var devicesInfo = GlobalData._devicesIdDatas["上游水位计"];
         string sw1Result = await GetSingleDevicesInfo(2, devicesInfo.dataGid.ToString(), devicesInfo.dataSid.ToString(),
             "d", 10000);
         //Debug.Log("sw1Resultsw1Resultsw1Result上游水位计:" + sw1Result);
@@ -1210,7 +1209,7 @@ public class HttpHelper : MonoBehaviour
             Debug.LogWarning("补元上游水位不成功,原因:" + e.ToString());
         }
 
-        var devicesInfo1 = _devicesIdDatas["下游水位计"];
+        var devicesInfo1 = GlobalData._devicesIdDatas["下游水位计"];
         string sw2Result = await GetSingleDevicesInfo(2, devicesInfo1.dataGid.ToString(), devicesInfo1.dataSid.ToString(),
             "d", 100000);
         Debug.Log("sw1Resultsw1Resultsw1Result下游水位计:" + sw2Result);
@@ -1308,7 +1307,7 @@ public class HttpHelper : MonoBehaviour
 
     public async Task InitSWYJData2()
     {
-        var devicesInfo = _devicesIdDatas["SWJ01YQ"];
+        var devicesInfo = GlobalData._devicesIdDatas["SWJ01YQ"];
         Debug.Log(devicesInfo.dataGid);
         Debug.Log(devicesInfo.dataSid);
         string sw1Result = await GetSingleDevicesInfo(1, devicesInfo.dataGid.ToString(), devicesInfo.dataSid.ToString(), "d", 10000);
@@ -1347,7 +1346,7 @@ public class HttpHelper : MonoBehaviour
             Debug.LogWarning("套口上游水位不成功,原因:" + e.ToString());
         }
 
-        var devicesInfo1 = _devicesIdDatas["SWJ02YQ"];
+        var devicesInfo1 = GlobalData._devicesIdDatas["SWJ02YQ"];
         string sw2Result = await GetSingleDevicesInfo(1, devicesInfo1.dataGid.ToString(), devicesInfo1.dataSid.ToString(),
             "d", 100000);
         //Debug.Log("sw1Resultsw1Resultsw1Result下游水位计:" + sw2Result);
@@ -1581,11 +1580,10 @@ public class HttpHelper : MonoBehaviour
     public async void GetBuYuanDevicesGroupInfo()
     {
         Debug.Log("获取补元所有渗压记");
-        Debug.Log(_devicesIdDatas.Count);
         //获取所有渗压记
         //GetDevicesData tempData = new GetDevicesData();
         //tempData.idsList = new List<DevicesMessage>();
-        foreach (var device in _devicesIdDatas.Values)
+        foreach (var device in GlobalData._devicesIdDatas.Values)
         {
 
             if (device.stationName.Equals("补元") && device.sensorType.Equals("渗压计"))
@@ -1605,7 +1603,7 @@ public class HttpHelper : MonoBehaviour
 
         Debug.Log("获取补元所有位移记");
         //获取所有位移记
-        foreach (var device in _devicesIdDatas.Values)
+        foreach (var device in GlobalData._devicesIdDatas.Values)
         {
             if (device.stationName.Equals("补元") && device.sensorType.Equals("静力水准仪"))
             {
@@ -1627,7 +1625,7 @@ public class HttpHelper : MonoBehaviour
     {
         Debug.Log("获取套口所有渗压记");
         //获取所有渗压记
-        foreach (var device in _devicesIdDatas.Values)
+        foreach (var device in GlobalData._devicesIdDatas.Values)
         {
             if (device.stationName.Equals("套口") && device.sensorType.Equals("渗压计"))
             {
@@ -1646,7 +1644,7 @@ public class HttpHelper : MonoBehaviour
 
         Debug.Log("获取套口所有位移记");
         //获取所有位移记
-        foreach (var device in _devicesIdDatas.Values)
+        foreach (var device in GlobalData._devicesIdDatas.Values)
         {
             if (device.stationName.Equals("补元") && device.sensorType.Equals("静力水准仪"))
             {
@@ -2124,36 +2122,12 @@ public class HttpHelper : MonoBehaviour
             {
                 Debug.Log($"设备列表json :{www.downloadHandler.text}");
                 SensorListResult tempData = JsonUtility.FromJson<SensorListResult>(www.downloadHandler.text);
-                _devicesIdDatas = new Dictionary<string, DevicesId_Data>();
-                
-                
-                Dictionary<string, string> tempMap_BY = new Dictionary<string, string>();
-                Dictionary<string, string> tempMap_TK = new Dictionary<string, string>();
-
+                GlobalData._devicesIdDatas = new Dictionary<string, DevicesId_Data>();
                 
                 for (int i = 0; i < tempData.rows.Count; i++)
                 {
-                    if (tempData.rows[i].stationName.Equals("套口"))
-                    {
-                        tempMap_TK.TryAdd(tempData.rows[i].sensorType, tempData.rows[i].sensorName);
-                    }
-                    else
-                    {
-                        tempMap_BY.TryAdd(tempData.rows[i].sensorType, tempData.rows[i].sensorName);
-                    }
-                    
-                    _devicesIdDatas.Add(tempData.rows[i].sensorName, tempData.rows[i]);
-                }
-
-                foreach (var tempKey in tempMap_BY.Keys)
-                {
-                    Debug.Log("补元 设备类型:"+tempKey);
-                }
-                foreach (var tempKey in tempMap_TK.Keys)
-                {
-                    Debug.Log("套口 设备类型:"+tempKey);
+                    GlobalData._devicesIdDatas.Add(tempData.rows[i].sensorName, tempData.rows[i]);
                 }
-               
                 Debug.Log($"初始化设备列表成功!!! count:{tempData.total}");
             }
         }
@@ -2170,40 +2144,14 @@ public class HttpHelper : MonoBehaviour
             WWW localWWW = new WWW(Application.streamingAssetsPath + "/SensorList.json");
             await new UnityAsync.WaitUntil(() => { return localWWW.isDone; });
             SensorListResult tempData = JsonUtility.FromJson<SensorListResult>(localWWW.text);
-            _devicesIdDatas = new Dictionary<string, DevicesId_Data>();
+            GlobalData._devicesIdDatas = new Dictionary<string, DevicesId_Data>();
             for (int i = 0; i < tempData.rows.Count; i++)
             {
-                _devicesIdDatas.Add(tempData.rows[i].sensorName, tempData.rows[i]);
+                GlobalData._devicesIdDatas.Add(tempData.rows[i].sensorName, tempData.rows[i]);
             }
 
             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
-        //     }}
-        // });
     }
 }

+ 2 - 2
Assets/Scripts/UI/Data/DevicesId_Data.cs

@@ -14,8 +14,8 @@ public class DevicesId_Data
     public string valueType1;//单位
     public string valueType2;
     
-    [FormerlySerializedAs("DeviceID")] public int dataSid;
-    [FormerlySerializedAs("ChannelID")] public int dataGid;
+    [FormerlySerializedAs("DeviceID")] public string dataSid;
+    [FormerlySerializedAs("ChannelID")] public string dataGid;
     [FormerlySerializedAs("value")] public float realtimeValue1;
     public string realtimeValue2;
     public string dataUpdateTime;

+ 7 - 0
Assets/Scripts/UI/Data/GlobalData.cs

@@ -128,6 +128,13 @@ public class GlobalData
     /// </summary>
     public static SensorDataResult taoKouSensorData;
     
+    
+    /// <summary>
+    /// 所有设备数据列表
+    /// </summary>
+    public static Dictionary<string, DevicesId_Data> _devicesIdDatas = new Dictionary<string, DevicesId_Data>();
+
+    
     /// <summary>
     /// 补元水压计数据
     /// </summary>

+ 12 - 4
Assets/Scripts/UI/Data/GongChengLieBiaoData.cs

@@ -25,8 +25,16 @@ public enum GongChengState
 public enum GongChengType
 {
    all,
-   shuiWei,
-   shuiYa,
-   weiYi,
-   shiPin
+   shuiWei,//水位计
+   shenYaJi,//渗压计
+   jingLiShuiZhunYi,//静力水准仪
+   wenDu,//温度
+   yinZhangXianYi,//引张线仪
+   chuiXianZuoBiaoYi,//垂线坐标仪
+   tuYaLiJi,//土压力计
+   yingLiJi,//应力计
+   sanXiangWeiCuoJi,//三向位错计
+   erXiangCeFengJi,//二向测缝计
+   weiYiJi,//位移计
+   shiPin//监控
 }

+ 10 - 14
Assets/Scripts/UI/Item/GongChengLieBiaoItem.cs

@@ -15,7 +15,7 @@ public class GongChengLieBiaoItem : MonoBehaviour
     private Button _button;
 
     private Image _highLightImg;
-    
+
     public void Init()
     {
         _indexText = this.transform.Find("index").GetComponent<Text>();
@@ -30,16 +30,12 @@ public class GongChengLieBiaoItem : MonoBehaviour
     {
         switch (_currentData.type)
         {
-            case GongChengType.shuiWei:
-            case GongChengType.shuiYa:
-            case GongChengType.weiYi:
-                // if (GCJKLayer._Instance.currentSelectItem != null)
-                // {
-                //     GCJKLayer._Instance.currentSelectItem.SetHighLight(false);
-                // }
-                // GCJKLayer._Instance.currentSelectItem = this;
-                //SetHighLight(true);
-                GCJKLayer._Instance.OpenDeviceTrendPanel(_currentData.name,_currentData.type,_currentData.gid,_currentData.sid);
+            case GongChengType.all:
+            case GongChengType.shiPin:
+                break;
+            default:
+                GCJKLayer._Instance.OpenDeviceTrendPanel(_currentData.name, _currentData.type, _currentData.gid,
+                    _currentData.sid);
                 break;
         }
     }
@@ -68,14 +64,14 @@ public class GongChengLieBiaoItem : MonoBehaviour
                 _stateText.text = $"<color=#15DCFC>正常</color>";
                 break;
             case GongChengState.runing:
-                _stateText.text =  $"<color=#15DCFC>运行</color>";
+                _stateText.text = $"<color=#15DCFC>运行</color>";
                 break;
             case GongChengState.fix:
-                _stateText.text =  $"<color=#FFBC1D>养护</color>";
+                _stateText.text = $"<color=#FFBC1D>养护</color>";
                 break;
             case GongChengState.warning:
                 _stateText.text = $"<color=#EF491C>告警</color>";
                 break;
         }
     }
-}
+}

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

@@ -24,7 +24,7 @@ public class ShuiYaIconCtrl : MonoBehaviour
         
         _deviceData = new GongChengLieBiaoData();
         _deviceData.name = _data.name;
-        _deviceData.type = GongChengType.shuiYa;
+        _deviceData.type = GongChengType.shenYaJi;
         _deviceData.state = GongChengState.normal;
         _deviceData.sid = _data.sid;
         _deviceData.gid = _data.gid;

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

@@ -24,7 +24,7 @@ public class WeiYiIconCtrl : MonoBehaviour
         
         _deviceData = new GongChengLieBiaoData();
         _deviceData.name = _data.name;
-        _deviceData.type = GongChengType.weiYi;
+        _deviceData.type = GongChengType.jingLiShuiZhunYi;
         _deviceData.state = GongChengState.normal;
         _deviceData.sid = _data.sid;
         _deviceData.gid = _data.gid;

+ 58 - 10
Assets/Scripts/UI/UIView/GCJK/DeviceTrendPanel.cs

@@ -126,13 +126,37 @@ public class DeviceTrendPanel : MonoBehaviour
         switch (currentGongChengType)
         {
             case GongChengType.shuiWei:
-                typeText = "水位";
+                typeText = "水位/m";
                 break;
-            case GongChengType.shuiYa:
-                typeText = "水压";
+            case GongChengType.shenYaJi:
+                typeText = "渗压/KPa";
                 break;
-            case GongChengType.weiYi:
-                typeText = "位移";
+            case GongChengType.jingLiShuiZhunYi:
+                typeText = "位移/mm";
+                break;
+            case GongChengType.wenDu:
+                typeText = "温度/\u2103";
+                break;
+            case GongChengType.yinZhangXianYi:
+                typeText = "位移/mm";
+                break;
+            case GongChengType.chuiXianZuoBiaoYi:
+                typeText = "位移/mm";
+                break;
+            case GongChengType.tuYaLiJi:
+                typeText = "应力/MPa";
+                break;
+            case GongChengType.yingLiJi:
+                typeText = "应力/MPa";
+                break;
+            case GongChengType.sanXiangWeiCuoJi:
+                typeText = "位移/mm";
+                break;
+            case GongChengType.erXiangCeFengJi:
+                typeText = "位移/mm";
+                break;
+            case GongChengType.weiYiJi:
+                typeText = "位移/mm";
                 break;
         }
         YAxis tempXaxis = _LineChart.GetChartComponent<YAxis>();
@@ -183,13 +207,37 @@ public class DeviceTrendPanel : MonoBehaviour
             switch (currentGongChengType)
             {
                 case GongChengType.shuiWei:
-                    typeText = "水位";
+                    typeText = "水位/m";
+                    break;
+                case GongChengType.shenYaJi:
+                    typeText = "渗压/KPa";
+                    break;
+                case GongChengType.jingLiShuiZhunYi:
+                    typeText = "位移/mm";
+                    break;
+                case GongChengType.wenDu:
+                    typeText = "温度/\u2103";
+                    break;
+                case GongChengType.yinZhangXianYi:
+                    typeText = "位移/mm";
+                    break;
+                case GongChengType.chuiXianZuoBiaoYi:
+                    typeText = "位移/mm";
+                    break;
+                case GongChengType.tuYaLiJi:
+                    typeText = "应力/MPa";
+                    break;
+                case GongChengType.yingLiJi:
+                    typeText = "应力/MPa";
+                    break;
+                case GongChengType.sanXiangWeiCuoJi:
+                    typeText = "位移/mm";
                     break;
-                case GongChengType.shuiYa:
-                    typeText = "水压";
+                case GongChengType.erXiangCeFengJi:
+                    typeText = "位移/mm";
                     break;
-                case GongChengType.weiYi:
-                    typeText = "位移";
+                case GongChengType.weiYiJi:
+                    typeText = "位移/mm";
                     break;
             }
             tempSeries[0].serieName = typeText;

+ 190 - 67
Assets/Scripts/UI/UIView/GCJK/GCJKLayer.cs

@@ -181,12 +181,22 @@ public class GCJKLayer : YZTRootLayer
     private RectTransform _gongChengLieBiaoContent;
     public GameObject GongChengLieBiaoItemOri;
     private List<GongChengLieBiaoItem> currentGongChengLieBiaoItems = new List<GongChengLieBiaoItem>();
+
     private Button GClist_QuanBuButton;
-    private Button GClist_ShuiWeiButton;
-    private Button GClist_ShuiYaButton;
-    private Button GClist_WeiYiButton;
     private Button GClist_ShiPinButton;
+    private Button GClist_jingLiShuiZhunYiButton;
+    private Button GClist_ShenYaJiButton;
 
+    private Button GClist_ShuiWeiButton;
+    private Button GClist_WenDuButton;
+    private Button GClist_yinZhangXianYiButton;
+    private Button GClist_chuiXianZuoBiaoYiButton;
+    private Button GClist_tuYaLiJiButton;
+    private Button GClist_yingLiJiButton;
+    private Button GClist_sanXiangWeiCuoJiButton;
+    private Button GClist_erXiangCeFengJiButton;
+    private Button GClist_weiYiJiButton;
+    
     //视频监控
     [Header("监控数据")] public ObsPlayerPanel obsPanel;
     public GameObject obsItemPrefab;
@@ -221,8 +231,8 @@ public class GCJKLayer : YZTRootLayer
 
     public RectTransform main;
     public RectTransform miniMap;
-    public UnityEngine.UI.Button globalWeatherBtn;
-    public UnityEngine.UI.Button exitGlobalWeatherBtn;
+    public Button globalWeatherBtn;
+    public Button exitGlobalWeatherBtn;
 
     private ShuiWeiHistoryPanel _shuiWeiHistoryPanel;
 
@@ -232,8 +242,8 @@ public class GCJKLayer : YZTRootLayer
     public GameObject dropUnitPrefab;
     public GameObject weatherUnitPrefab;
 
-    public UnityEngine.UI.Button qxDataBtn;
-    public UnityEngine.UI.Button swDataBtn;
+    public Button qxDataBtn;
+    public Button swDataBtn;
 
     public Sprite highLightBtn;
     public Sprite normalBtn;
@@ -381,17 +391,42 @@ public class GCJKLayer : YZTRootLayer
         //工程列表
         _gongChengLieBiaoContent = this.transform.Find("RightUp/GongChengLieBiao/ScrollView/Viewport/Content")
             .GetComponent<RectTransform>();
-        GClist_QuanBuButton = this.transform.Find("RightUp/GongChengLieBiao/QuanBuButton").GetComponent<Button>();
+        
+        GClist_QuanBuButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_QuanBuButton").GetComponent<Button>();
         GClist_QuanBuButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.all); });
-        GClist_ShuiWeiButton = this.transform.Find("RightUp/GongChengLieBiao/ShuiWeiButton").GetComponent<Button>();
+        GClist_ShuiWeiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_ShuiWeiButton").GetComponent<Button>();
         GClist_ShuiWeiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.shuiWei); });
-        GClist_ShuiYaButton = this.transform.Find("RightUp/GongChengLieBiao/ShuiYaButton").GetComponent<Button>();
-        GClist_ShuiYaButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.shuiYa); });
-        GClist_WeiYiButton = this.transform.Find("RightUp/GongChengLieBiao/WeiYiButton").GetComponent<Button>();
-        GClist_WeiYiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.weiYi); });
-        GClist_ShiPinButton = this.transform.Find("RightUp/GongChengLieBiao/JianKongButton").GetComponent<Button>();
+        GClist_ShenYaJiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_ShenYaJiButton").GetComponent<Button>();
+        GClist_ShenYaJiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.shenYaJi); });
+        GClist_jingLiShuiZhunYiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_jingLiShuiZhunYiButton").GetComponent<Button>();
+        GClist_jingLiShuiZhunYiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.jingLiShuiZhunYi); });
+        GClist_ShiPinButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_ShiPinButton").GetComponent<Button>();
         GClist_ShiPinButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.shiPin); });
-
+        
+        GClist_WenDuButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_WenDuButton").GetComponent<Button>();
+        GClist_WenDuButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.wenDu); });
+        
+        GClist_yinZhangXianYiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_yinZhangXianYiButton").GetComponent<Button>();
+        GClist_yinZhangXianYiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.yinZhangXianYi); });
+        
+        GClist_chuiXianZuoBiaoYiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_chuiXianZuoBiaoYiButton").GetComponent<Button>();
+        GClist_chuiXianZuoBiaoYiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.chuiXianZuoBiaoYi); });
+        
+        GClist_tuYaLiJiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_tuYaLiJiButton").GetComponent<Button>();
+        GClist_tuYaLiJiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.tuYaLiJi); });
+        
+        GClist_yingLiJiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_yingLiJiButton").GetComponent<Button>();
+        GClist_yingLiJiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.yingLiJi); });
+        
+        GClist_sanXiangWeiCuoJiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_sanXiangWeiCuoJiButton").GetComponent<Button>();
+        GClist_sanXiangWeiCuoJiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.sanXiangWeiCuoJi); });
+        
+        GClist_erXiangCeFengJiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_erXiangCeFengJiButton").GetComponent<Button>();
+        GClist_erXiangCeFengJiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.erXiangCeFengJi); });
+        
+        GClist_weiYiJiButton = this.transform.Find("RightUp/GongChengLieBiao/buttons/GClist_weiYiJiButton").GetComponent<Button>();
+        GClist_weiYiJiButton.onClick.AddListener(() => { SeachGongChengList(GongChengType.weiYiJi); });
+        
         //监控
         obsPanel = this.transform.Find("Main/ObsPlayerPanel").GetComponent<ObsPlayerPanel>();
         obsPanel.gameObject.SetActive(false);
@@ -633,6 +668,15 @@ public class GCJKLayer : YZTRootLayer
                 }
             }
             
+            GClist_ShuiWeiButton.gameObject.SetActive(false);
+            GClist_WenDuButton.gameObject.SetActive(true);
+            GClist_yinZhangXianYiButton.gameObject.SetActive(false);
+            GClist_chuiXianZuoBiaoYiButton.gameObject.SetActive(false);
+            GClist_tuYaLiJiButton.gameObject.SetActive(false);
+            GClist_yingLiJiButton.gameObject.SetActive(false);
+            GClist_sanXiangWeiCuoJiButton.gameObject.SetActive(false);
+            GClist_erXiangCeFengJiButton.gameObject.SetActive(false);
+            GClist_weiYiJiButton.gameObject.SetActive(false);
         }
         else
         {
@@ -665,6 +709,15 @@ public class GCJKLayer : YZTRootLayer
                     swXY.SetData(swDownName,swDown,swTargets[i].transform);
                 }
             }
+            GClist_ShuiWeiButton.gameObject.SetActive(false);
+            GClist_WenDuButton.gameObject.SetActive(false);
+            GClist_yinZhangXianYiButton.gameObject.SetActive(true);
+            GClist_chuiXianZuoBiaoYiButton.gameObject.SetActive(true);
+            GClist_tuYaLiJiButton.gameObject.SetActive(true);
+            GClist_yingLiJiButton.gameObject.SetActive(true);
+            GClist_sanXiangWeiCuoJiButton.gameObject.SetActive(true);
+            GClist_erXiangCeFengJiButton.gameObject.SetActive(true);
+            GClist_weiYiJiButton.gameObject.SetActive(true);
         }
             
         
@@ -834,46 +887,57 @@ public class GCJKLayer : YZTRootLayer
     public void SetGongChengLieBiaoData()
     {
         _DevivesDatas.Clear();
-        //水位
-        foreach (var tempData in currentDataType == 0
-                     ? GlobalData.BuYuanShuiWeiDataList
-                     : GlobalData.TaoKouShuiWeiDataList)
-        {
-            GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
-            tempLieBiaoData.name = tempData.name;
-            tempLieBiaoData.type = GongChengType.shuiWei;
-            tempLieBiaoData.state = GongChengState.normal;
-            tempLieBiaoData.sid = tempData.sid;
-            tempLieBiaoData.gid = tempData.gid;
-            _DevivesDatas.Add(tempLieBiaoData);
-        }
-
-        //水压
-        foreach (var tempData in currentDataType == 0
-                     ? GlobalData.BuYuanShuiYaDataList
-                     : GlobalData.TaoKouShuiYaDataList)
-        {
-            GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
-            tempLieBiaoData.name = tempData.name;
-            tempLieBiaoData.type = GongChengType.shuiYa;
-            tempLieBiaoData.state = GongChengState.normal;
-            tempLieBiaoData.sid = tempData.sid;
-            tempLieBiaoData.gid = tempData.gid;
-            _DevivesDatas.Add(tempLieBiaoData);
-        }
 
-        //位移
-        foreach (var tempData in currentDataType == 0 ? GlobalData.BuYuanWeiYiDataList : GlobalData.TaoKouWeiYiDataList)
+        string stationName = currentDataType == 0 ? "补元" : "套口";
+        foreach (var devicesData in GlobalData._devicesIdDatas.Values)
         {
-            GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
-            tempLieBiaoData.name = tempData.name;
-            tempLieBiaoData.type = GongChengType.weiYi;
-            tempLieBiaoData.state = GongChengState.normal;
-            tempLieBiaoData.sid = tempData.sid;
-            tempLieBiaoData.gid = tempData.gid;
-            _DevivesDatas.Add(tempLieBiaoData);
+            if (devicesData.stationName.Equals(stationName))
+            {
+                GongChengLieBiaoData tempLieBiaoData = new GongChengLieBiaoData();
+                tempLieBiaoData.name = devicesData.sensorName;
+                switch (devicesData.sensorType)
+                {
+                    case "水位计":
+                        tempLieBiaoData.type = GongChengType.shuiWei;
+                        break;
+                    case "渗压计":
+                        tempLieBiaoData.type = GongChengType.shenYaJi;
+                        break;
+                    case "静力水准仪":
+                        tempLieBiaoData.type = GongChengType.jingLiShuiZhunYi;
+                        break;
+                    case "温度":
+                        tempLieBiaoData.type = GongChengType.wenDu;
+                        break;
+                    case "引张线仪":
+                        tempLieBiaoData.type = GongChengType.yinZhangXianYi;
+                        break;
+                    case "垂线坐标仪":
+                        tempLieBiaoData.type = GongChengType.chuiXianZuoBiaoYi;
+                        break;
+                    case "土压力计":
+                        tempLieBiaoData.type = GongChengType.tuYaLiJi;
+                        break;
+                    case "应力计":
+                        tempLieBiaoData.type = GongChengType.yingLiJi;
+                        break;
+                    case "三向位错计":
+                        tempLieBiaoData.type = GongChengType.sanXiangWeiCuoJi;
+                        break;
+                    case "二向测缝计":
+                        tempLieBiaoData.type = GongChengType.erXiangCeFengJi;
+                        break;
+                    case "位移计":
+                        tempLieBiaoData.type = GongChengType.weiYiJi;
+                        break;
+                }
+                tempLieBiaoData.state = GongChengState.normal;
+                tempLieBiaoData.sid = devicesData.dataSid;
+                tempLieBiaoData.gid = devicesData.dataGid;
+                _DevivesDatas.Add(tempLieBiaoData);
+            }
         }
-
+        
         //监控
         foreach (var tempData in currentDataType == 0 ? GlobalData.obsDatas_by : GlobalData.obsDatas_tk)
         {
@@ -888,8 +952,8 @@ public class GCJKLayer : YZTRootLayer
 
         GClist_QuanBuButton.GetComponentInChildren<Text>().color = Color.white;
         GClist_ShuiWeiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
-        GClist_ShuiYaButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
-        GClist_WeiYiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_ShenYaJiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_jingLiShuiZhunYiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
         GClist_ShiPinButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
         for (int i = 0; i < currentGongChengLieBiaoItems.Count; i++)
         {
@@ -913,9 +977,17 @@ public class GCJKLayer : YZTRootLayer
     {
         GClist_QuanBuButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
         GClist_ShuiWeiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
-        GClist_ShuiYaButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
-        GClist_WeiYiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_ShenYaJiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_jingLiShuiZhunYiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
         GClist_ShiPinButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_WenDuButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_yinZhangXianYiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_chuiXianZuoBiaoYiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_tuYaLiJiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_yingLiJiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_sanXiangWeiCuoJiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_erXiangCeFengJiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
+        GClist_weiYiJiButton.GetComponentInChildren<Text>().color = new Color(0.6470588f, 0.7490196f, 0.8862745f);
         switch (type)
         {
             case GongChengType.all:
@@ -924,7 +996,6 @@ public class GCJKLayer : YZTRootLayer
                 {
                     obj.gameObject.SetActive(true);
                 }
-
                 break;
             case GongChengType.shuiWei:
                 GClist_ShuiWeiButton.GetComponentInChildren<Text>().color = Color.white;
@@ -932,23 +1003,20 @@ public class GCJKLayer : YZTRootLayer
                 {
                     obj.gameObject.SetActive(obj._currentData.type == GongChengType.shuiWei);
                 }
-
                 break;
-            case GongChengType.shuiYa:
-                GClist_ShuiYaButton.GetComponentInChildren<Text>().color = Color.white;
+            case GongChengType.shenYaJi:
+                GClist_ShenYaJiButton.GetComponentInChildren<Text>().color = Color.white;
                 foreach (var obj in currentGongChengLieBiaoItems)
                 {
-                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.shuiYa);
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.shenYaJi);
                 }
-
                 break;
-            case GongChengType.weiYi:
-                GClist_WeiYiButton.GetComponentInChildren<Text>().color = Color.white;
+            case GongChengType.jingLiShuiZhunYi:
+                GClist_jingLiShuiZhunYiButton.GetComponentInChildren<Text>().color = Color.white;
                 foreach (var obj in currentGongChengLieBiaoItems)
                 {
-                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.weiYi);
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.jingLiShuiZhunYi);
                 }
-
                 break;
             case GongChengType.shiPin:
                 GClist_ShiPinButton.GetComponentInChildren<Text>().color = Color.white;
@@ -956,7 +1024,62 @@ public class GCJKLayer : YZTRootLayer
                 {
                     obj.gameObject.SetActive(obj._currentData.type == GongChengType.shiPin);
                 }
-
+                break;
+            case GongChengType.wenDu:
+                GClist_WenDuButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.wenDu);
+                }
+                break;
+            case GongChengType.yinZhangXianYi:
+                GClist_yinZhangXianYiButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.yinZhangXianYi);
+                }
+                break;
+            case GongChengType.chuiXianZuoBiaoYi:
+                GClist_chuiXianZuoBiaoYiButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.chuiXianZuoBiaoYi);
+                }
+                break;
+            case GongChengType.tuYaLiJi:
+                GClist_tuYaLiJiButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.tuYaLiJi);
+                }
+                break;
+            case GongChengType.yingLiJi:
+                GClist_yingLiJiButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.yingLiJi);
+                }
+                break;
+            case GongChengType.sanXiangWeiCuoJi:
+                GClist_sanXiangWeiCuoJiButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.sanXiangWeiCuoJi);
+                }
+                break;
+            case GongChengType.erXiangCeFengJi:
+                GClist_erXiangCeFengJiButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.erXiangCeFengJi);
+                }
+                break;
+            case GongChengType.weiYiJi:
+                GClist_weiYiJiButton.GetComponentInChildren<Text>().color = Color.white;
+                foreach (var obj in currentGongChengLieBiaoItems)
+                {
+                    obj.gameObject.SetActive(obj._currentData.type == GongChengType.weiYiJi);
+                }
                 break;
         }
     }

Some files were not shown because too many files changed in this diff