Explorar o código

保留2位小数

“hujiajun” hai 3 semanas
pai
achega
2a0b4be17d

+ 18 - 18
Assets/DataManager.cs

@@ -313,7 +313,7 @@ public static string Md5(string str)
             {
                 LineChartSeriesData lc = new LineChartSeriesData();
                 lc.name = data.serverList[i].name;
-                lc.values = new List<float>();
+                lc.values = new List<double>();
                 for (int z = 0; z < datamsg["data"][typestr].Count; z++)
                 {
                     if(data.serverList[i].name == datamsg["data"][typestr][z]["server_room_name"].ToString())
@@ -354,7 +354,7 @@ public static string Md5(string str)
         {
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "数据_"+ i;
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int j = 0; j < 20; j++)
             {
                 lc.values.Add(UnityEngine.Random.Range(1, 1000));
@@ -542,7 +542,7 @@ public static string Md5(string str)
 
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "温度";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_24h_temp"].Count; i++)
             {
                 data.xdata.Add(datamsg["data"]["last_24h_temp"][i]["date"].ToString().Split(' ')[1]);
@@ -554,7 +554,7 @@ public static string Md5(string str)
 
             LineChartSeriesData lc2 = new LineChartSeriesData();
             lc2.name = "湿度";
-            lc2.values = new List<float>();
+            lc2.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_24h_humi"].Count; i++)
             {
                 lc2.values.Add(float.Parse(datamsg["data"]["last_24h_humi"][i]["value"].ToString()));
@@ -570,7 +570,7 @@ public static string Md5(string str)
 
             lc = new LineChartSeriesData();
             lc.name = "温度";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_day_temp"].Count; i++)
             {
                 data.xdata.Add(datamsg["data"]["last_day_temp"][i]["date"].ToString().Split(' ')[1]);
@@ -582,7 +582,7 @@ public static string Md5(string str)
 
             lc2 = new LineChartSeriesData();
             lc2.name = "湿度";
-            lc2.values = new List<float>();
+            lc2.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_day_humi"].Count; i++)
             {
                 lc2.values.Add(float.Parse(datamsg["data"]["last_day_humi"][i]["value"].ToString()));
@@ -597,7 +597,7 @@ public static string Md5(string str)
 
             lc = new LineChartSeriesData();
             lc.name = "温度";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_week_temp"].Count; i++)
             {
                 data.xdata.Add(datamsg["data"]["last_week_temp"][i]["date"].ToString().Split(' ')[0]);
@@ -609,7 +609,7 @@ public static string Md5(string str)
 
             lc2 = new LineChartSeriesData();
             lc2.name = "湿度";
-            lc2.values = new List<float>();
+            lc2.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_week_humi"].Count; i++)
             {
                 lc2.values.Add(float.Parse(datamsg["data"]["last_week_humi"][i]["value"].ToString()));
@@ -625,7 +625,7 @@ public static string Md5(string str)
 
             lc = new LineChartSeriesData();
             lc.name = "温度";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_month_temp"].Count; i++)
             {
                 data.xdata.Add(datamsg["data"]["last_month_temp"][i]["date"].ToString().Split(' ')[0]);
@@ -637,7 +637,7 @@ public static string Md5(string str)
 
             lc2 = new LineChartSeriesData();
             lc2.name = "湿度";
-            lc2.values = new List<float>();
+            lc2.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["last_month_humi"].Count; i++)
             {
                 lc2.values.Add(float.Parse(datamsg["data"]["last_month_humi"][i]["value"].ToString()));
@@ -996,7 +996,7 @@ public static string Md5(string str)
 
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "今日";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0; i < datamsg["data"][ "today_info"].Count; i++)
             {
                 data.xdata.Add(datamsg["data"]["today_info"][i]["time"].ToString().Split(' ')[1]);
@@ -1007,7 +1007,7 @@ public static string Md5(string str)
 
             LineChartSeriesData lc2 = new LineChartSeriesData();
             lc2.name = "昨日";
-            lc2.values = new List<float>();
+            lc2.values = new List<double>();
             for (int i = 0; i < datamsg["data"]["yesterday_info"].Count; i++)
             {
                 lc2.values.Add(float.Parse( datamsg["data"]["yesterday_info"][i]["value"].ToString()));
@@ -1029,7 +1029,7 @@ public static string Md5(string str)
 
         LineChartSeriesData lc = new LineChartSeriesData();
         lc.name = "数据1";
-        lc.values = new List<float>();
+        lc.values = new List<double>();
         for (int i = 0; i < 10; i++)
         {
             lc.values.Add(UnityEngine.Random.Range(1, 800));
@@ -1039,7 +1039,7 @@ public static string Md5(string str)
 
         LineChartSeriesData lc2 = new LineChartSeriesData();
         lc2.name = "数据2";
-        lc2.values = new List<float>();
+        lc2.values = new List<double>();
         for (int i = 0; i < 10; i++)
         {
             lc2.values.Add(UnityEngine.Random.Range(1, 800));
@@ -1062,7 +1062,7 @@ public static string Md5(string str)
             {
                 LineChartSeriesData lc = new LineChartSeriesData();
                 lc.name = datamsg["data"]["prop_ame"][i].ToString();
-                lc.values = new List<float>();
+                lc.values = new List<double>();
 
                 data.sdata.Add(lc);
 
@@ -1101,7 +1101,7 @@ public static string Md5(string str)
 
         LineChartSeriesData lc = new LineChartSeriesData();
         lc.name = "数据1";
-        lc.values = new List<float>();
+        lc.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc.values.Add(UnityEngine.Random.Range(1, 1000));
@@ -1111,7 +1111,7 @@ public static string Md5(string str)
 
         LineChartSeriesData lc2 = new LineChartSeriesData();
         lc2.name = "数据2";
-        lc2.values = new List<float>();
+        lc2.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc2.values.Add(UnityEngine.Random.Range(1, 1000));
@@ -1120,7 +1120,7 @@ public static string Md5(string str)
 
         LineChartSeriesData lc3 = new LineChartSeriesData();
         lc3.name = "数据3";
-        lc3.values = new List<float>();
+        lc3.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc3.values.Add(UnityEngine.Random.Range(1, 1000));

+ 13 - 12
Assets/DeMaDataManager.cs

@@ -198,7 +198,7 @@ public class DeMaDataManager : MonoBehaviour
     
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "kWh";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             data.xdata.AddRange(GetHoursArray2());
             for (int i = 0; i < data.xdata.Count; i++)
             {
@@ -246,7 +246,7 @@ Debug.Log("error==>"+msg);
 
         LineChartSeriesData lc = new LineChartSeriesData();
         lc.name = "数据1";
-        lc.values = new List<float>();
+        lc.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc.values.Add(UnityEngine.Random.Range(1, 1000));
@@ -269,11 +269,11 @@ Debug.Log("error==>"+msg);
 
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "kWh";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0;i<d["data"]["list"].Count;i++)
             {
                 data.xdata.Add(changedate(d["data"]["list"][i]["date"].ToString(),1));
-                lc.values.Add(float.Parse(d["data"]["list"][i]["value"].ToString()));
+                lc.values.Add(double.Parse(d["data"]["list"][i]["value"].ToString()));
             }
             data.sdata.Add(lc);
 
@@ -290,7 +290,7 @@ Debug.Log("error==>"+msg);
 
         LineChartSeriesData lc = new LineChartSeriesData();
         lc.name = "数据1";
-        lc.values = new List<float>();
+        lc.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc.values.Add(UnityEngine.Random.Range(1, 1000));
@@ -329,7 +329,7 @@ Debug.Log("error==>"+msg);
 
         LineChartSeriesData lc = new LineChartSeriesData();
         lc.name = "数据1";
-        lc.values = new List<float>();
+        lc.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc.values.Add(UnityEngine.Random.Range(1, 1000));
@@ -353,7 +353,7 @@ Debug.Log("error==>"+msg);
 
         LineChartSeriesData lc = new LineChartSeriesData();
         lc.name = "数据1";
-        lc.values = new List<float>();
+        lc.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc.values.Add(UnityEngine.Random.Range(1, 1000));
@@ -393,11 +393,12 @@ Debug.Log("error==>"+msg);
 
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "kWh";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             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()));
+                lc.values.Add(double.Parse(double.Parse(d["data"]["list"][i]["value"].ToString()).ToString("F2")));
+              //  lc.values.Add(1.3f);
             }
             data.sdata.Add(lc);
 
@@ -443,7 +444,7 @@ Debug.Log("error==>"+msg);
 
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "kWh";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0;i<d["data"]["list"].Count;i++)
             {
                 data.xdata.Add(changedate(d["data"]["list"][i]["date"].ToString(),idx));
@@ -495,7 +496,7 @@ Debug.Log("error==>"+msg);
 
             LineChartSeriesData lc = new LineChartSeriesData();
             lc.name = "kWh";
-            lc.values = new List<float>();
+            lc.values = new List<double>();
             for (int i = 0;i<d["data"]["list"].Count;i++)
             {
                 data.xdata.Add(changedate(d["data"]["list"][i]["date"].ToString(),idx));
@@ -521,7 +522,7 @@ Debug.Log("msg error===>"+msg);
 
         LineChartSeriesData lc = new LineChartSeriesData();
         lc.name = "数据1";
-        lc.values = new List<float>();
+        lc.values = new List<double>();
         for (int i = 0; i < 20; i++)
         {
             lc.values.Add(UnityEngine.Random.Range(1, 1000));

+ 2 - 2
Assets/Manager.cs

@@ -146,7 +146,7 @@ public class Manager
     public class LineChartSeriesData
     {
         public string name;
-        public List<float> values;
+        public List<double> values;
     }
 
 
@@ -177,7 +177,6 @@ public class Manager
             if (lineChart.series.Count > i)
             {
                 lineChart.series[i].serieName = data.sdata[i].name;
-                Debug.Log(data.sdata[i].values.Count);
                 lineChart.series[i].ClearData();
                 for (int j = 0; j < data.sdata[i].values.Count; j++)
                 {
@@ -187,6 +186,7 @@ public class Manager
                         sd.data = new List<double>();
                         sd.data.Add(j);
                         sd.data.Add(data.sdata[i].values[j]);
+               // Debug.Log(data.sdata[i].values[j]);
                         lineChart.series[i].data.Add(sd);
                     }
                     else

+ 8 - 0
Assets/XR.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: d19d7f98346854aea91fbb04e8cc45f0
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/XR/Loaders.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: dcaae1ac4c9e341138ebeebcafce0413
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 8 - 0
Assets/XR/Settings.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 88f17751a6cfa4fc1a37fcbe1d9ac30e
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 42 - 0
Assets/XR/Settings/OpenXRPackageSettings.asset

@@ -0,0 +1,42 @@
+%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: 0}
+  m_Name: OpenXRPackageSettings
+  m_EditorClassIdentifier: 
+  Keys: 01000000
+  Values:
+  - {fileID: 3889694330548161310}
+--- !u!114 &3889694330548161310
+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: 0}
+  m_Name: Standalone
+  m_EditorClassIdentifier: Unity.XR.OpenXR:UnityEngine.XR.OpenXR:OpenXRSettings
+  features: []
+  m_renderMode: 1
+  m_autoColorSubmissionMode: 1
+  m_colorSubmissionModes:
+    m_List: 00000000
+  m_eyeTrackingPermissionsToRequest:
+  - com.oculus.permission.EYE_TRACKING
+  - android.permission.EYE_TRACKING
+  - android.permission.EYE_TRACKING_FINE
+  m_depthSubmissionMode: 0
+  m_optimizeBufferDiscards: 0
+  m_symmetricProjection: 0
+  versionChanged: 0

+ 8 - 0
Assets/XR/Settings/OpenXRPackageSettings.asset.meta

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

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


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


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


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


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

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

BIN=BIN
DeMaDemo/DeMa/德马大屏20241202 Build-1.zip


+ 4 - 4
Packages/packages-lock.json

@@ -53,16 +53,16 @@
       "source": "builtin",
       "dependencies": {
         "com.unity.ide.visualstudio": "2.0.22",
-        "com.unity.ide.rider": "3.0.27",
+        "com.unity.ide.rider": "3.0.34",
         "com.unity.ide.vscode": "1.2.5",
         "com.unity.editorcoroutines": "1.0.0",
         "com.unity.performance.profile-analyzer": "1.2.2",
         "com.unity.test-framework": "1.1.33",
-        "com.unity.testtools.codecoverage": "1.2.5"
+        "com.unity.testtools.codecoverage": "1.2.6"
       }
     },
     "com.unity.ide.rider": {
-      "version": "3.0.27",
+      "version": "3.0.34",
       "depth": 1,
       "source": "registry",
       "dependencies": {
@@ -112,7 +112,7 @@
       "url": "https://packages.unity.com"
     },
     "com.unity.testtools.codecoverage": {
-      "version": "1.2.5",
+      "version": "1.2.6",
       "depth": 1,
       "source": "registry",
       "dependencies": {

+ 4 - 12
ProjectSettings/EditorBuildSettings.asset

@@ -6,18 +6,10 @@ EditorBuildSettings:
   serializedVersion: 2
   m_Scenes:
   - enabled: 0
-    path: Assets/Scenes/Main.unity
-    guid: 5ea76ae314a0343609542d170f632eb7
+    path: Assets/Scenes/16-9 1.unity
+    guid: 5473e0afc5645488f9552f1d91ab7b1e
   - enabled: 1
     path: Assets/Scenes/16-9.unity
     guid: 2c06667ba91fb4021ae25015b2251ae1
-  - enabled: 0
-    path: Assets/Scenes/32-9.unity
-    guid: 9fc0d4010bbf28b4594072e72b8655ab
-  - enabled: 0
-    path: Assets/Scenes/16-9green.unity
-    guid: 47f0ee876e33345bcac1dd630347cd3e
-  - enabled: 0
-    path: Assets/Scenes/32-9green.unity
-    guid: 0d8c746afb2d14c69a64aa5dcf2a37da
-  m_configObjects: {}
+  m_configObjects:
+    com.unity.xr.openxr.settings4: {fileID: 11400000, guid: 88d56196fcded404e872049addf39a06, type: 2}