Browse Source

修改拖动 以及 通讯

“hujiajun” 5 months ago
parent
commit
4c093bb3e7
41 changed files with 1811 additions and 110 deletions
  1. BIN
      AssetBundles/WebGL/WebGL
  2. 1 1
      AssetBundles/WebGL/WebGL.manifest
  3. BIN
      AssetBundles/WebGL/德马科技
  4. 3 3
      AssetBundles/WebGL/德马科技.manifest
  5. 25 0
      Assets/CameraToPose.cs
  6. 54 0
      Assets/DataTypeManager.cs
  7. 11 0
      Assets/DataTypeManager.cs.meta
  8. 120 39
      Assets/DeMaDataManager.cs
  9. 53 0
      Assets/DeMaGongYeCheJian.cs
  10. 11 0
      Assets/DeMaGongYeCheJian.cs.meta
  11. 53 0
      Assets/DeMaKeJiCheJian.cs
  12. 11 0
      Assets/DeMaKeJiCheJian.cs.meta
  13. 62 1
      Assets/GameManager.cs
  14. 1000 29
      Assets/Scenes/16-9.unity
  15. 59 0
      Assets/Scenes/DeMaConfig.asset
  16. 8 0
      Assets/Scenes/DeMaConfig.asset.meta
  17. 28 0
      Assets/Scenes/DeMaConfig.cs
  18. 11 0
      Assets/Scenes/DeMaConfig.cs.meta
  19. 4 1
      Assets/Scenes/SimpleCameraController.cs
  20. BIN
      Assets/Scenes/园区建筑导出 3/德马科技.FBX
  21. 5 2
      Assets/SetWebGLText.cs
  22. 26 21
      Assets/SheBeiShiShiType.cs
  23. 1 1
      Assets/StreamingAssets/1.txt
  24. BIN
      Assets/StreamingAssets/bd/德马科技
  25. 9 9
      Assets/TuBiao.cs
  26. 105 0
      Assets/image/1.mat
  27. 8 0
      Assets/image/1.mat.meta
  28. BIN
      Assets/image/电力@1x 1.png
  29. 140 0
      Assets/image/电力@1x 1.png.meta
  30. BIN
      DeMaDemo/DeMa/Build/DeMa.data.unityweb
  31. BIN
      DeMaDemo/DeMa/Build/DeMa.framework.js.unityweb
  32. BIN
      DeMaDemo/DeMa/Build/DeMa.symbols.json.unityweb
  33. BIN
      DeMaDemo/DeMa/Build/DeMa.wasm.unityweb
  34. 1 1
      DeMaDemo/DeMa/StreamingAssets/1.txt
  35. BIN
      DeMaDemo/DeMa/StreamingAssets/bd/德马科技
  36. BIN
      DeMaDemo/DeMa/德马大屏20241115-2.zip
  37. BIN
      DeMaDemo/DeMa/德马大屏20241115-3.zip
  38. BIN
      DeMaDemo/DeMa/德马大屏20241122 Build.zip
  39. BIN
      DeMaDemo/DeMa/德马大屏20241122-1.zip
  40. BIN
      DeMaDemo/DeMa/德马大屏20241125-1.zip
  41. 2 2
      ProjectSettings/QualitySettings.asset

BIN
AssetBundles/WebGL/WebGL


+ 1 - 1
AssetBundles/WebGL/WebGL.manifest

@@ -1,5 +1,5 @@
 ManifestFileVersion: 0
-CRC: 2740188672
+CRC: 3630932546
 AssetBundleManifest:
   AssetBundleInfos:
     Info_0:

BIN
AssetBundles/WebGL/德马科技


+ 3 - 3
AssetBundles/WebGL/德马科技.manifest

@@ -1,15 +1,15 @@
 ManifestFileVersion: 0
-CRC: 1366306644
+CRC: 3005183365
 Hashes:
   AssetFileHash:
     serializedVersion: 2
-    Hash: ce3315a1f355b5913348e9c5d894f1a1
+    Hash: 933e81248f7ad8daad46e564f885ab78
   TypeTreeHash:
     serializedVersion: 2
     Hash: d27d605e56b00c7d193d3604b99a7461
   IncrementalBuildHash:
     serializedVersion: 2
-    Hash: ce3315a1f355b5913348e9c5d894f1a1
+    Hash: 933e81248f7ad8daad46e564f885ab78
 HashAppended: 0
 ClassTypes:
 - Class: 1

+ 25 - 0
Assets/CameraToPose.cs

@@ -8,6 +8,7 @@ using UnityTemplateProjects;
 
 public class CameraToPose : MonoBehaviour
 {
+    public List<GameObject> devItemTypeGoList;
     public GameObjectType type;
     public TapName tapName;
     public Camera cam;
@@ -29,6 +30,30 @@ public class CameraToPose : MonoBehaviour
         {
             GameManager.Instance.showW(type,tapName);
             moveTo();
+
+                if(devItemTypeGoList.Count>0&&tapName!=TapName.工业车间总览&&tapName!=TapName.科技车间总览)
+                {
+                    if(type == GameObjectType.工业车间||type == GameObjectType.科技车间)
+                    {
+                        DeMaDataManager.Instance.GetDeviceType(GameManager.Instance.getID(tapName),(msg)=>{
+                            try
+                            {
+                                for(int i=0;i<msg["data"]["list"].Count;i++)
+                                {
+                                    devItemTypeGoList[i].GetComponentInChildren<Text>().text =DeMaDataManager.changedate( msg["data"]["list"][i]["date"].ToString(),4);
+                                    devItemTypeGoList[i].GetComponentInChildren<DataTypeManager>().init(msg["data"]["list"][i]);
+                                }
+                            }
+                            catch
+                            {
+
+                            }
+                    
+
+                    });
+                    }
+
+                }
         }
 
     }

+ 54 - 0
Assets/DataTypeManager.cs

@@ -0,0 +1,54 @@
+using System.Collections;
+using System.Collections.Generic;
+using LitJson;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class DataTypeManager : MonoBehaviour
+{
+    List<GameObject> objlist=new List<GameObject>();
+    public void init(JsonData data)
+    {
+        int max =this.transform.childCount;
+        for (int i = 0;i<objlist.Count;i++)
+        {
+           Destroy( objlist[i]);
+        }
+        float total =0;
+        for (int i = 0;i<data["value"].Count;i++)
+        {
+            total+=float.Parse(data["value"][i]["count"].ToString());
+        }
+        for (int i = 0;i<data["value"].Count;i++)
+        {
+            GameObject go =new GameObject("item_"+i);
+            objlist.Add(go);
+            go.transform.parent=this.transform;
+            go.transform.localPosition = Vector3.zero;
+            go.transform.localScale = Vector3.one;
+            RawImage rw = go.AddComponent<RawImage>();
+            rw.color = GetColor(int.Parse(data["value"][i]["status"].ToString()));
+            go.GetComponent<RectTransform>().sizeDelta = new Vector2(float.Parse(data["value"][i]["count"].ToString())/total*100f, go.GetComponent<RectTransform>().sizeDelta.y);
+        }
+    }
+
+    public static Color GetColor(int colorid)
+    {
+        switch(colorid)
+        {
+            case 1:
+            return Color.green;
+            break;
+            case 2:
+            return Color.yellow;
+            break;
+            case 3:
+            return Color.red;
+            break;
+            case 4:
+            return Color.gray;
+            break;
+        }
+        return Color.gray;
+    }
+}

+ 11 - 0
Assets/DataTypeManager.cs.meta

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

+ 120 - 39
Assets/DeMaDataManager.cs

@@ -163,11 +163,24 @@ public class DeMaDataManager : MonoBehaviour
     }
     public static string[] GetHoursArray2()
     {
-        return Enumerable.Range(0, 24)
+        return Enumerable.Range(0, 25)
                         .Select(hour => hour.ToString("D2"))
                         .Select(hour => $"{hour}:00")
                         .ToArray();
     }
+    public void GetDeviceType(string id,Action<JsonData> callback)
+    {
+        JsonData jsonData =new  JsonData();
+        jsonData["deviceCode"]=id;
+        StartCoroutine(Post_Demo("/digital-twin/v1/device/runtime", jsonData.ToJson(), (string msg) => {
+
+             JsonData d =JsonMapper.ToObject(msg);
+             callback.Invoke(d);
+
+        }));
+        
+    }
+
     public void GetJinRiRanQi(Action<LineChartData> callback)
     {
         LineChartData data = new LineChartData();
@@ -245,7 +258,7 @@ Debug.Log("error==>"+msg);
 
         callback.Invoke(data);
     }
-    
+     
     public void GetLeiJiRanqi(Action<LineChartData> callback)
     {
         LineChartData data = new LineChartData();
@@ -289,6 +302,21 @@ Debug.Log("error==>"+msg);
 
         callback.Invoke(data);
     }
+    public void GetDeviceInfo(string id,Action<JsonData> callback)
+    {
+        JsonData dataj=new JsonData();
+        dataj["buID"] =int.Parse(id) ;
+        LineChartData data = new LineChartData();
+        data.xdata = new List<string>();
+        data.sdata = new List<LineChartSeriesData>();
+        StartCoroutine(Post_Demo("/digital-twin/v1/device/realtime",dataj.ToJson(), (string msg) => {
+            JsonData d =JsonMapper.ToObject(msg);
+
+            callback.Invoke(d);
+
+        }));
+        return;
+    }
     public void GetgongyeZaiXian(Action<LineChartData> callback,int idx)
     {
             LineChartData data = new LineChartData();
@@ -337,54 +365,106 @@ Debug.Log("error==>"+msg);
 
         callback.Invoke(data);
     }
-    public void GetKeJiZaiXian(Action<LineChartData> callback,int idx)
-    {
-            LineChartData data = new LineChartData();
-        data.xdata = new List<string>();
-        data.sdata = new List<LineChartSeriesData>();
-        for (int i = 0; i < 20; i++)
-        {
-            data.xdata.Add("xdata_" + i);
-        }
+    public void GetKeJiZaiXian(string url,Action<LineChartData> callback,int idx,int type)
+    { 
+        JsonData datas =new JsonData();
 
-        LineChartSeriesData lc = new LineChartSeriesData();
-        lc.name = "数据1";
-        lc.values = new List<float>();
-        for (int i = 0; i < 20; i++)
+        switch(idx)
         {
-            lc.values.Add(UnityEngine.Random.Range(1, 1000));
+            case 1:
+            datas["mode"] = "day";
+            break;
+            case 2:
+            datas["mode"] = "week";
+            break;
+            case 3:
+            datas["mode"] = "month";
+            break;
         }
-        data.sdata.Add(lc);
+        datas["buID"] = type;
+        LineChartData data = new LineChartData();
+        data.xdata = new List<string>();
+        data.sdata = new List<LineChartSeriesData>();
+        StartCoroutine(Post_Demo(url, datas.ToJson(), (string msg) => {
+            try
+            {
 
+            JsonData d =JsonMapper.ToObject(msg);
 
-   
+            LineChartSeriesData lc = new LineChartSeriesData();
+            lc.name = "kWh";
+            lc.values = new List<float>();
+            for (int i = 0;i<d["data"]["list"].Count;i++)
+            {
+                data.xdata.Add(changedate(d["data"]["list"][i]["date"].ToString(),idx));
+                lc.values.Add(float.Parse(d["data"]["list"][i]["value"].ToString()));
+            }
+            data.sdata.Add(lc);
+
+
+            callback.Invoke(data);
+            }
+            catch
+            {
+                Debug.Log("msg error===>"+msg);
+            }
+            
+
+        }));
+        return;
 
-        callback.Invoke(data);
     }
     
-    public void GetGaoJingData(Action<LineChartData> callback,int idx)
-    {
-            LineChartData data = new LineChartData();
-        data.xdata = new List<string>();
-        data.sdata = new List<LineChartSeriesData>();
-        for (int i = 0; i < 20; i++)
-        {
-            data.xdata.Add("xdata_" + i);
-        }
+    public void GetGaoJingData(Action<LineChartData> callback,int idx,int type)
+    { 
+        JsonData datas =new JsonData();
 
-        LineChartSeriesData lc = new LineChartSeriesData();
-        lc.name = "数据1";
-        lc.values = new List<float>();
-        for (int i = 0; i < 20; i++)
+        switch(idx)
         {
-            lc.values.Add(UnityEngine.Random.Range(1, 1000));
+            case 1:
+            datas["mode"] = "day";
+            break;
+            case 2:
+            datas["mode"] = "week";
+            break;
+            case 3:
+            datas["mode"] = "month";
+            break;
         }
-        data.sdata.Add(lc);
+        datas["buID"] = type;
+        LineChartData data = new LineChartData();
+        data.xdata = new List<string>();
+        data.sdata = new List<LineChartSeriesData>();
+        StartCoroutine(Post_Demo("/digital-twin/v1/device/ratio/alarm", datas.ToJson(), (string msg) => {
+            try
+            {
 
+            JsonData d =JsonMapper.ToObject(msg);
 
-   
+            LineChartSeriesData lc = new LineChartSeriesData();
+            lc.name = "kWh";
+            lc.values = new List<float>();
+            for (int i = 0;i<d["data"]["list"].Count;i++)
+            {
+                data.xdata.Add(changedate(d["data"]["list"][i]["date"].ToString(),idx));
+                lc.values.Add(float.Parse(d["data"]["list"][i]["value"].ToString()));
+                Debug.Log(" data.xdata=1=>"+ d["data"]["list"][i]["date"].ToString());
+                Debug.Log(" data.xdata=2=>"+ data.xdata[ data.xdata.Count-1]);
+            }
+            data.sdata.Add(lc);
+
+
+            callback.Invoke(data);
+            }
+            catch
+            {
+                Debug.Log("msg error===>"+msg);
+            }
+            
+
+        }));
+        return;
 
-        callback.Invoke(data);
     }
      
     public void GetZongyongdianData(Action<LineChartData> callback,int idx)
@@ -420,8 +500,6 @@ Debug.Log("error==>"+msg);
             {
                 data.xdata.Add(changedate(d["data"]["list"][i]["date"].ToString(),idx));
                 lc.values.Add(float.Parse(d["data"]["list"][i]["value"].ToString()));
-                Debug.Log(" data.xdata=1=>"+ d["data"]["list"][i]["date"].ToString());
-                Debug.Log(" data.xdata=2=>"+ data.xdata[ data.xdata.Count-1]);
             }
             data.sdata.Add(lc);
 
@@ -473,7 +551,7 @@ Debug.Log("msg error===>"+msg);
     
         return dateTimeCn;
     }
-    public string changedate(string time,int i)
+    public static string changedate(string time,int i)
     { 
         DateTime dateTime = UnixTimeStampToDateTime(long.Parse(time));
  
@@ -492,6 +570,9 @@ Debug.Log("msg error===>"+msg);
             case 3:
             return  dateTime.ToString("MM月");
             break;
+            case 4:
+            return  dateTime.ToString("MM-dd");
+            break;
         }
         return time; 
     }

+ 53 - 0
Assets/DeMaGongYeCheJian.cs

@@ -0,0 +1,53 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using XCharts.Runtime;
+
+public class DeMaGongYeCheJian : MonoBehaviour
+{
+    public RingChart rcr;
+    public RingChart rcg;
+    public RingChart rcd;
+    public RingChart rcl;
+    public Text rcrt;
+    public Text rcgt;
+    public Text rcdt;
+    public Text rclt;
+
+    private void OnEnable() {
+       DeMaDataManager.Instance.GetDeviceInfo(  GameManager.Instance.getID(this.gameObject.GetComponent<GameType>().tapName),(msg)=>{
+
+        int total =int.Parse(msg["data"]["run"].ToString())+
+                    int.Parse(msg["data"]["standby"].ToString())+
+                    int.Parse(msg["data"]["fault"].ToString())+
+                    int.Parse(msg["data"]["offline"].ToString());
+                if(total==0)
+                {
+                    total = 1;
+                }
+                SerieData data1 = rcr.series[0].GetSerieData(0);
+                data1.data[0] = int.Parse(msg["data"]["run"].ToString());
+                data1.data[1] = total;
+                rcrt.text = msg["data"]["run"].ToString()+"台";
+
+
+                SerieData data2 = rcg.series[0].GetSerieData(0);
+                data2.data[0] = int.Parse(msg["data"]["standby"].ToString());
+                data2.data[1] = total;
+                rcgt.text = msg["data"]["standby"].ToString()+"台";
+
+
+                SerieData data3 = rcd.series[0].GetSerieData(0);
+                data3.data[0] = int.Parse(msg["data"]["fault"].ToString());
+                data3.data[1] = total;
+                rcdt.text = msg["data"]["fault"].ToString()+"台";
+
+
+                SerieData data4 = rcl.series[0].GetSerieData(0);
+                data4.data[0] = int.Parse(msg["data"]["offline"].ToString());
+                data4.data[1] = total;
+                rclt.text = msg["data"]["offline"].ToString()+"台";
+       });
+    }
+}

+ 11 - 0
Assets/DeMaGongYeCheJian.cs.meta

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

+ 53 - 0
Assets/DeMaKeJiCheJian.cs

@@ -0,0 +1,53 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+using XCharts.Runtime;
+
+public class DeMaKeJiCheJian : MonoBehaviour
+{
+    public RingChart rcr;
+    public RingChart rcg;
+    public RingChart rcd;
+    public RingChart rcl;
+    public Text rcrt;
+    public Text rcgt;
+    public Text rcdt;
+    public Text rclt;
+
+    private void OnEnable() {
+       DeMaDataManager.Instance.GetDeviceInfo(  GameManager.Instance.getID(this.gameObject.GetComponent<GameType>().tapName),(msg)=>{
+
+        int total =int.Parse(msg["data"]["run"].ToString())+
+                    int.Parse(msg["data"]["standby"].ToString())+
+                    int.Parse(msg["data"]["fault"].ToString())+
+                    int.Parse(msg["data"]["offline"].ToString());
+                if(total==0)
+                {
+                    total = 1;
+                }
+                SerieData data1 = rcr.series[0].GetSerieData(0);
+                data1.data[0] = int.Parse(msg["data"]["run"].ToString());
+                data1.data[1] = total;
+                rcrt.text = msg["data"]["run"].ToString()+"台";
+
+
+                SerieData data2 = rcg.series[0].GetSerieData(0);
+                data2.data[0] = int.Parse(msg["data"]["standby"].ToString());
+                data2.data[1] = total;
+                rcgt.text = msg["data"]["standby"].ToString()+"台";
+
+
+                SerieData data3 = rcd.series[0].GetSerieData(0);
+                data3.data[0] = int.Parse(msg["data"]["fault"].ToString());
+                data3.data[1] = total;
+                rcdt.text = msg["data"]["fault"].ToString()+"台";
+
+
+                SerieData data4 = rcl.series[0].GetSerieData(0);
+                data4.data[0] = int.Parse(msg["data"]["offline"].ToString());
+                data4.data[1] = total;
+                rclt.text = msg["data"]["offline"].ToString()+"台";
+       });
+    }
+}

+ 11 - 0
Assets/DeMaKeJiCheJian.cs.meta

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

+ 62 - 1
Assets/GameManager.cs

@@ -4,10 +4,12 @@ using System.Collections.Generic;
 using System.ComponentModel;
 using UnityEngine;
 using UnityTemplateProjects;
+using static DeMaConfig;
 using static InitTapList;
 
 public class GameManager : MonoBehaviour
 {
+    public DeMaConfig config;
     public SimpleCameraController smp;
     [Serializable]
     public enum TuBiaoType
@@ -38,8 +40,10 @@ public class GameManager : MonoBehaviour
         科技车间=2,
         [ChineseDescription("工业车间")]
         工业车间=3,
+        [ChineseDescription("电力")]
+        电力=4,
         [ChineseDescription("其他")]
-        其他=3,
+        其他=5,
     }
     
     // 定义枚举
@@ -142,6 +146,7 @@ public class GameManager : MonoBehaviour
         }
     }
     public List<GameObject> wlist;
+    public List<GameObject> dlist;
     public List<GameObject> keji;
     public List<GameObject> gongye;
     void showkeji()
@@ -191,14 +196,58 @@ public class GameManager : MonoBehaviour
                         wlist[i].SetActive(false);
                     }
                 }
+
+                for(var i=0;i<dlist.Count;i++)
+                {
+                    dlist[i].SetActive(TapName.园区总览==tapName);
+                }
+                        SimpleCameraController.smallclickct = 5;
             break;
             case GameObjectType.科技车间:
                 keji[0].SetActive(tapName == TapName.科技车间总览);
                 keji[1].SetActive(tapName != TapName.科技车间总览);
+                    for(var i=0;i<dlist.Count;i++)
+                    {
+                        dlist[i].SetActive(false);
+                    }
+                    if(tapName != TapName.科技车间总览)
+                    {
+                        SimpleCameraController.smallclickct = 2;
+                    }else
+                    {
+                        SimpleCameraController.smallclickct = 5;
+
+                    }
             break;
             case  GameObjectType.工业车间:
                 gongye[0].SetActive(tapName == TapName.工业车间总览);
                 gongye[1].SetActive(tapName != TapName.工业车间总览);
+                    for(var i=0;i<dlist.Count;i++)
+                    {
+                        dlist[i].SetActive(false);
+                    }
+                    if(tapName != TapName.工业车间总览)
+                    {
+                        SimpleCameraController.smallclickct = 2;
+                    }else
+                    {
+                        SimpleCameraController.smallclickct = 5;
+
+                    }
+            break;
+            case GameObjectType.电力:
+                for(var i=0;i<dlist.Count;i++)
+                {
+                    if(dlist[i].GetComponent<GameType>().tapName==tapName)
+                    {
+                        dlist[i].SetActive(true);
+                    }
+                    else
+                    {
+                        dlist[i].SetActive(false);
+                    }
+                }
+                        SimpleCameraController.smallclickct = 5;
             break;
         }
         smp.initpos();
@@ -247,4 +296,16 @@ public class GameManager : MonoBehaviour
 
         
     }
+
+    public string getID(TapName tapName)
+    {
+        for (int i = 0;i<GameManager.Instance.config.TaskList.Count;i++)
+        {
+            if(tapName == GameManager.Instance.config.TaskList[i].type)
+            {
+                return GameManager.Instance.config.TaskList[i].ID;
+            }
+        }
+        return "";
+    }
 }

File diff suppressed because it is too large
+ 1000 - 29
Assets/Scenes/16-9.unity


+ 59 - 0
Assets/Scenes/DeMaConfig.asset

@@ -0,0 +1,59 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!114 &11400000
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 0}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 339066397f0644aef8466802a8372c6d, type: 3}
+  m_Name: DeMaConfig
+  m_EditorClassIdentifier: 
+  TaskList:
+  - type: 30002
+    ID: D1LM-282
+  - type: 30005
+    ID: D1LM-311
+  - type: 30008
+    ID: D1ZLM-001
+  - type: 30003
+    ID: D1LM-257
+  - type: 30006
+    ID: D1LM-319
+  - type: 30004
+    ID: D1LM-262
+  - type: 30007
+    ID: D1LM-317
+  - type: 30010
+    ID: D1LM-318
+  - type: 30011
+    ID: D1LM-194
+  - type: 20002
+    ID: S-167
+  - type: 20003
+    ID: S-168-1
+  - type: 20004
+    ID: S-168-2
+  - type: 20005
+    ID: S-461
+  - type: 20006
+    ID: S-21
+  - type: 20007
+    ID: S-22
+  - type: 20008
+    ID: S-390
+  - type: 20009
+    ID: S-368
+  - type: 20010
+    ID: S-467
+  - type: 20011
+    ID: S-18-1
+  - type: 20012
+    ID: PWJ
+  - type: 10002
+    ID: 1
+  - type: 10003
+    ID: 2

+ 8 - 0
Assets/Scenes/DeMaConfig.asset.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 8c32173d9fa9f42c8b3efa8caad2eea8
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 11400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 28 - 0
Assets/Scenes/DeMaConfig.cs

@@ -0,0 +1,28 @@
+
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using static DeMaConfig.windowItemGameObject;
+using static GameManager;
+
+[CreateAssetMenu(menuName = "DeMaConfig")]
+public class DeMaConfig : ScriptableObject
+{
+    public List<TaskItem> TaskList;
+
+    [Serializable]
+    public abstract class windowItemGameObject
+    {
+        public abstract List<TaskItem> TaskList { get; set; }
+
+        [System.Serializable]
+        public class TaskItem
+        {
+            public TapName type;
+            public string ID ;
+
+        }
+    }
+
+     
+}

+ 11 - 0
Assets/Scenes/DeMaConfig.cs.meta

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

+ 4 - 1
Assets/Scenes/SimpleCameraController.cs

@@ -53,6 +53,7 @@ namespace UnityTemplateProjects
                 t.position = new Vector3(x, y, z);
             }
         }
+        public static int smallclickct =5;
 
         const float k_MouseSensitivityMultiplier = 0.01f;
 
@@ -213,12 +214,14 @@ namespace UnityTemplateProjects
             // Hide and lock cursor when right mouse button pressed
             if (IsRightMouseButtonDown())
             {
+              //  boost=smallclickct;
                 //Cursor.lockState = CursorLockMode.Locked;
             }
 
             // Unlock and show cursor when right mouse button released
             if (IsRightMouseButtonUp())
             {
+               // boost=5;
                // Cursor.visible = true;
                // Cursor.lockState = CursorLockMode.None;
             }
@@ -336,7 +339,7 @@ namespace UnityTemplateProjects
 #if ENABLE_INPUT_SYSTEM
             return Mouse.current != null ? Mouse.current.rightButton.isPressed : false;
 #else
-            return Input.GetMouseButtonDown(1);
+            return Input.GetMouseButtonDown(0);
 #endif
         }
 

BIN
Assets/Scenes/园区建筑导出 3/德马科技.FBX


+ 5 - 2
Assets/SetWebGLText.cs

@@ -20,6 +20,9 @@ public class SetWebGLText : MonoBehaviour
     }
     IEnumerator Downloadip()
     {
+        yield return null;
+        DeMaDataManager.ip = Application.streamingAssetsPath.Split("/StreamingAssets")[0]+"/api";
+/*
         Debug.Log("开始获取ip文件" + Application.streamingAssetsPath + "/1.txt");
         UnityWebRequest m_webrequest = UnityWebRequest.Get(Application.streamingAssetsPath + "/1.txt");
         yield return m_webrequest.SendWebRequest();
@@ -35,7 +38,7 @@ public class SetWebGLText : MonoBehaviour
             DeMaDataManager.ip = RemoveWhitespace(m_webrequest.downloadHandler.text);
             Debug.Log("获取ip文件成功==》" + DataManager.ip);
 
-        }
+        }*/
     }
     string RemoveWhitespace(string input)
     {
@@ -57,7 +60,7 @@ public class SetWebGLText : MonoBehaviour
                     yield return null;
                 }
                 DataManager.ip = RemoveWhitespace(fileData.Result);
-                DeMaDataManager.ip = RemoveWhitespace(fileData.Result);
+                 DeMaDataManager.ip = RemoveWhitespace(fileData.Result);
             }
             else{
                 

+ 26 - 21
Assets/SheBeiShiShiType.cs

@@ -18,34 +18,39 @@ public class SheBeiShiShiType : UpdateManager
     public RingChart lixianrc;
     override public void updateData()
     {
-        base.updateData();     
-        StartCoroutine(DeMaDataManager.Instance.GetShishiType((str)=>{
-                runtext.text = str[0].ct.ToString();
-
+        base.updateData();        
+        DeMaDataManager.Instance.GetDeviceInfo( "0",(msg)=>{
+
+        int total =int.Parse(msg["data"]["run"].ToString())+
+                    int.Parse(msg["data"]["standby"].ToString())+
+                    int.Parse(msg["data"]["fault"].ToString())+
+                    int.Parse(msg["data"]["offline"].ToString());
+                if(total==0)
+                {
+                    total = 1;
+                }
                 SerieData data1 = runrc.series[0].GetSerieData(0);
-                data1.data[0] = str[0].ct;
-                data1.data[1] = 100;
-
-
-                guzhangtext.text = str[0].ct.ToString();
-
-                SerieData data2 = guzhangrc.series[0].GetSerieData(0);
-                data2.data[0] = str[1].ct;
-                data2.data[1] = 100;
+                data1.data[0] = int.Parse(msg["data"]["run"].ToString());
+                data1.data[1] = total;
+                runtext.text = msg["data"]["run"].ToString()+"台";
 
 
-                daijitext.text = str[0].ct.ToString();
+                SerieData data2 = daijirc.series[0].GetSerieData(0);
+                data2.data[0] = int.Parse(msg["data"]["standby"].ToString());
+                data2.data[1] = total;
+                daijitext.text = msg["data"]["standby"].ToString()+"台";
 
-                SerieData data3 = daijirc.series[0].GetSerieData(0);
-                data3.data[0] = str[2].ct;
-                data3.data[1] = 100;
 
+                SerieData data3 = guzhangrc.series[0].GetSerieData(0);
+                data3.data[0] = int.Parse(msg["data"]["fault"].ToString());
+                data3.data[1] = total;
+                guzhangtext.text = msg["data"]["fault"].ToString()+"台";
 
-                lixiantext.text = str[0].ct.ToString();
 
                 SerieData data4 = lixianrc.series[0].GetSerieData(0);
-                data4.data[0] = str[3].ct;
-                data4.data[1] = 100;
-        })) ;
+                data4.data[0] = int.Parse(msg["data"]["offline"].ToString());
+                data4.data[1] = total;
+                lixiantext.text = msg["data"]["offline"].ToString()+"台";
+       });
     }
 }

+ 1 - 1
Assets/StreamingAssets/1.txt

@@ -1 +1 @@
-http://202.107.242.12:3008/api
+http://192.168.50.114:8888

BIN
Assets/StreamingAssets/bd/德马科技


+ 9 - 9
Assets/TuBiao.cs

@@ -20,14 +20,14 @@ public class TuBiao : UpdateManager
         switch(type)
         {
             case TuBiaoType.科技设备利用率:
-                DeMaDataManager.Instance.GetKeJiZaiXian((data) => {
+                DeMaDataManager.Instance.GetKeJiZaiXian("/digital-twin/v1/device/ratio/run",(data) => {
                     setLineData(lc, data);
-                },index);
+                },index,1);
             break;
             case TuBiaoType.科技设备在线率:
-                DeMaDataManager.Instance.GetKeJiZaiXian((data) => {
+                DeMaDataManager.Instance.GetKeJiZaiXian("/digital-twin/v1/device/ratio/online",(data) => {
                     setLineData(lc, data);
-                },index);
+                },index,1);
             break;
             case TuBiaoType.今日燃气流量:
                 DeMaDataManager.Instance.GetJinRiRanQi((data) => {
@@ -35,14 +35,14 @@ public class TuBiao : UpdateManager
                 });
             break;
             case TuBiaoType.工业设备利用率:
-                DeMaDataManager.Instance.GetgongyeLiYong((data) => {
+                DeMaDataManager.Instance.GetKeJiZaiXian("/digital-twin/v1/device/ratio/run",(data) => {
                     setLineData(lc, data);
-                },index);
+                },index,2);
             break;
             case TuBiaoType.工业设备在线率:
-                DeMaDataManager.Instance.GetgongyeZaiXian((data) => {
+                DeMaDataManager.Instance.GetKeJiZaiXian("/digital-twin/v1/device/ratio/online",(data) => {
                     setLineData(lc, data);
-                },index);
+                },index,2);
             break;
             case TuBiaoType.总用电量:
                 DeMaDataManager.Instance.GetZongyongdianData((data) => {
@@ -52,7 +52,7 @@ public class TuBiao : UpdateManager
             case TuBiaoType.设备报警率:
                 DeMaDataManager.Instance.GetGaoJingData((data) => {
                     setLineData(lc, data);
-                },index);
+                },index,0);
             break;
             case TuBiaoType.累计燃气用量:
                 DeMaDataManager.Instance.GetLeiJiRanqi((data) => {

+ 105 - 0
Assets/image/1.mat

@@ -0,0 +1,105 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+  serializedVersion: 8
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: 1
+  m_Shader: {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
+  m_Parent: {fileID: 0}
+  m_ModifiedSerializedProperties: 0
+  m_ValidKeywords: []
+  m_InvalidKeywords: []
+  m_LightmapFlags: 4
+  m_EnableInstancingVariants: 0
+  m_DoubleSidedGI: 0
+  m_CustomRenderQueue: -1
+  stringTagMap: {}
+  disabledShaderPasses: []
+  m_LockedProperties: 
+  m_SavedProperties:
+    serializedVersion: 3
+    m_TexEnvs:
+    - _BumpMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailAlbedoMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailBump:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailMask:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailNormalMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _DetailTex:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _EmissionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainBump:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MainTex:
+        m_Texture: {fileID: 2800000, guid: dec6bf142694c4773ab7a59f01d9ed12, type: 3}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _MetallicGlossMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _OcclusionMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    - _ParallaxMap:
+        m_Texture: {fileID: 0}
+        m_Scale: {x: 1, y: 1}
+        m_Offset: {x: 0, y: 0}
+    m_Ints: []
+    m_Floats:
+    - _BumpScale: 1
+    - _ColorMask: 15
+    - _Cutoff: 0.5
+    - _DetailNormalMapScale: 1
+    - _DstBlend: 0
+    - _GlossMapScale: 1
+    - _Glossiness: 0.5
+    - _GlossyReflections: 1
+    - _Metallic: 0
+    - _Mode: 0
+    - _OcclusionStrength: 1
+    - _Parallax: 0.02
+    - _Shininess: 0.2
+    - _SmoothnessTextureChannel: 0
+    - _SpecularHighlights: 1
+    - _SrcBlend: 1
+    - _Stencil: 0
+    - _StencilComp: 8
+    - _StencilOp: 0
+    - _StencilReadMask: 255
+    - _StencilWriteMask: 255
+    - _Strength: 0
+    - _UVSec: 0
+    - _UseUIAlphaClip: 0
+    - _ZWrite: 1
+    m_Colors:
+    - _Color: {r: 1, g: 1, b: 1, a: 1}
+    - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+    - _Specular: {r: 0, g: 0, b: 0, a: 0}
+  m_BuildTextureStacks: []

+ 8 - 0
Assets/image/1.mat.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 45831cabc01714b26997cc422966c027
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 2100000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
Assets/image/电力@1x 1.png


+ 140 - 0
Assets/image/电力@1x 1.png.meta

@@ -0,0 +1,140 @@
+fileFormatVersion: 2
+guid: dec6bf142694c4773ab7a59f01d9ed12
+TextureImporter:
+  internalIDToNameTable: []
+  externalObjects: {}
+  serializedVersion: 12
+  mipmaps:
+    mipMapMode: 0
+    enableMipMap: 1
+    sRGBTexture: 1
+    linearTexture: 0
+    fadeOut: 0
+    borderMipMap: 0
+    mipMapsPreserveCoverage: 0
+    alphaTestReferenceValue: 0.5
+    mipMapFadeDistanceStart: 1
+    mipMapFadeDistanceEnd: 3
+  bumpmap:
+    convertToNormalMap: 0
+    externalNormalMap: 0
+    heightScale: 0.25
+    normalMapFilter: 0
+    flipGreenChannel: 0
+  isReadable: 0
+  streamingMipmaps: 0
+  streamingMipmapsPriority: 0
+  vTOnly: 0
+  ignoreMipmapLimit: 0
+  grayScaleToAlpha: 0
+  generateCubemap: 6
+  cubemapConvolution: 0
+  seamlessCubemap: 0
+  textureFormat: 1
+  maxTextureSize: 2048
+  textureSettings:
+    serializedVersion: 2
+    filterMode: 1
+    aniso: 1
+    mipBias: 0
+    wrapU: 0
+    wrapV: 0
+    wrapW: 0
+  nPOTScale: 1
+  lightmap: 0
+  compressionQuality: 50
+  spriteMode: 0
+  spriteExtrude: 1
+  spriteMeshType: 1
+  alignment: 0
+  spritePivot: {x: 0.5, y: 0.5}
+  spritePixelsToUnits: 100
+  spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+  spriteGenerateFallbackPhysicsShape: 1
+  alphaUsage: 1
+  alphaIsTransparency: 0
+  spriteTessellationDetail: -1
+  textureType: 0
+  textureShape: 1
+  singleChannelComponent: 0
+  flipbookRows: 1
+  flipbookColumns: 1
+  maxTextureSizeSet: 0
+  compressionQualitySet: 0
+  textureFormatSet: 0
+  ignorePngGamma: 0
+  applyGammaDecoding: 0
+  swizzle: 50462976
+  cookieLightType: 0
+  platformSettings:
+  - serializedVersion: 3
+    buildTarget: DefaultTexturePlatform
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 3
+    buildTarget: WebGL
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 3
+    buildTarget: Standalone
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  - serializedVersion: 3
+    buildTarget: VisionOS
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
+  spriteSheet:
+    serializedVersion: 2
+    sprites: []
+    outline: []
+    physicsShape: []
+    bones: []
+    spriteID: 
+    internalID: 0
+    vertices: []
+    indices: 
+    edges: []
+    weights: []
+    secondaryTextures: []
+    nameFileIdTable: {}
+  mipmapLimitGroupName: 
+  pSDRemoveMatte: 0
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

BIN
DeMaDemo/DeMa/Build/DeMa.data.unityweb


BIN
DeMaDemo/DeMa/Build/DeMa.framework.js.unityweb


BIN
DeMaDemo/DeMa/Build/DeMa.symbols.json.unityweb


BIN
DeMaDemo/DeMa/Build/DeMa.wasm.unityweb


+ 1 - 1
DeMaDemo/DeMa/StreamingAssets/1.txt

@@ -1 +1 @@
-http://202.107.242.12:3008/api
+http://192.168.50.114:8888

BIN
DeMaDemo/DeMa/StreamingAssets/bd/德马科技


BIN
DeMaDemo/DeMa/德马大屏20241115-2.zip


BIN
DeMaDemo/DeMa/德马大屏20241115-3.zip


BIN
DeMaDemo/DeMa/德马大屏20241122 Build.zip


BIN
DeMaDemo/DeMa/德马大屏20241120-1.zip → DeMaDemo/DeMa/德马大屏20241122-1.zip


BIN
DeMaDemo/DeMa/德马大屏20241115-1.zip → DeMaDemo/DeMa/德马大屏20241125-1.zip


+ 2 - 2
ProjectSettings/QualitySettings.asset

@@ -169,7 +169,7 @@ QualitySettings:
     globalTextureMipmapLimit: 0
     textureMipmapLimitSettings: []
     anisotropicTextures: 1
-    antiAliasing: 0
+    antiAliasing: 8
     softParticles: 0
     softVegetation: 1
     realtimeReflectionProbes: 1
@@ -267,7 +267,7 @@ QualitySettings:
     globalTextureMipmapLimit: 0
     textureMipmapLimitSettings: []
     anisotropicTextures: 2
-    antiAliasing: 2
+    antiAliasing: 8
     softParticles: 1
     softVegetation: 1
     realtimeReflectionProbes: 1

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