浏览代码

修复一下趋势图,验证过了

Void_F 2 周之前
父节点
当前提交
bd62e27504

+ 11 - 8
Assets/Bitsplash/Modular Date Picker/Base/Script/DropDown/DatePickerDropDownBase.cs

@@ -7,7 +7,6 @@ using UnityEngine.UI;
 
 namespace Bitsplash.DatePicker
 {
-    [Serializable]
     public abstract class DatePickerDropDownBase : MonoBehaviour
     {
 
@@ -101,15 +100,19 @@ namespace Bitsplash.DatePicker
         {
             var d = GetSelectedDate(); // get the selected date
             string t = NoSelectionPrompt;
-            try
+            if (d != null)
             {
-                if (d.HasValue)
-                    t = d.Value.ToString("labelDateFormat"); // find the correct string to show for the selected date
-            }
-            catch(Exception)
-            {
-                Debug.LogWarning("the format specified for the drop down is not valid");
+                t = d.Value.ToString("yyyy-MM-dd");
             }
+            // try
+            // {
+            //     if (d.HasValue)
+            //         t = d.Value.ToString("labelDateFormat"); // find the correct string to show for the selected date
+            // }
+            // catch(Exception)
+            // {
+            //     Debug.LogWarning("the format specified for the drop down is not valid");
+            // }
             SetText(t); // show the selected date
             Hide();
         }

+ 1 - 1
Assets/Bitsplash/Modular Date Picker/TextMeshPro/Script/DatePickerDropDownTextMeshPro.cs

@@ -3,10 +3,10 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using UnityEngine;
 
 namespace Bitsplash.DatePicker
 {
-    [Serializable]
     public class DatePickerDropDownTextMeshPro : DatePickerDropDownBase
     {
         public TMPro.TextMeshProUGUI Label= null;

+ 7 - 7
Assets/ModelAniTool.cs

@@ -28,13 +28,13 @@ public class ModelAniTool : MonoBehaviour
 
     private void Update()
     {
-        if (aniType == AniType.buYuan) {
-            if (GlobalData.buYuanSensorData.data.Count > 0) {
-                for (int i = 0; i < targetObjs.Length; i++) {
-                    Debug.Log(GlobalData.buYuanSensorData.data[0].opening_degree);
-                }
-            }
-        }
+        // if (aniType == AniType.buYuan) {
+        //     if (GlobalData.buYuanSensorData.data.Count > 0) {
+        //         for (int i = 0; i < targetObjs.Length; i++) {
+        //             Debug.Log(GlobalData.buYuanSensorData.data[0].opening_degree);
+        //         }
+        //     }
+        // }
     }
     public void FindObje()
     {

+ 92 - 10
Assets/Prefabs/UI/XHYZT/GCJK.prefab

@@ -3138,7 +3138,7 @@ RectTransform:
   m_Children:
   - {fileID: 8659344151934832620}
   m_Father: {fileID: 1830498978117052941}
-  m_RootOrder: 10
+  m_RootOrder: 11
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0.5, y: 0.5}
   m_AnchorMax: {x: 0.5, y: 0.5}
@@ -5386,10 +5386,10 @@ RectTransform:
   m_Father: {fileID: 6150641734031777260}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 1, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 0, y: 250}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: -98, y: -15}
+  m_SizeDelta: {x: 320, y: 250}
   m_Pivot: {x: 0.5, y: 1}
 --- !u!114 &1859124770048725146
 MonoBehaviour:
@@ -12759,7 +12759,7 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 5cde14b682a49eb4fa7cdce34de69813, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  isOpen: 0
+  isOpen: 1
   CellPrefab: {fileID: 4153907790430587759}
   Format: ddd
 --- !u!1 &4153907791179720159
@@ -13697,10 +13697,10 @@ RectTransform:
   m_Father: {fileID: 8444861806439875334}
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 1, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 0, y: 250}
+  m_AnchorMin: {x: 0.5, y: 0.5}
+  m_AnchorMax: {x: 0.5, y: 0.5}
+  m_AnchoredPosition: {x: -98, y: -15}
+  m_SizeDelta: {x: 320, y: 250}
   m_Pivot: {x: 0.5, y: 1}
 --- !u!114 &4153907792208891504
 MonoBehaviour:
@@ -14456,6 +14456,7 @@ RectTransform:
   - {fileID: 8444861806439875334}
   - {fileID: 6150641734031777260}
   - {fileID: 6986089733291623242}
+  - {fileID: 5476494592397253505}
   - {fileID: 5643974596644282410}
   m_Father: {fileID: 2332442566715947249}
   m_RootOrder: 11
@@ -14598,6 +14599,7 @@ MonoBehaviour:
   closeButton: {fileID: 0}
   resetButton: {fileID: 0}
   checkButton: {fileID: 0}
+  tipsText: {fileID: 0}
   DatePicker_Start: {fileID: 0}
   DatePicker_End: {fileID: 0}
   startDateStr: 
@@ -19064,6 +19066,86 @@ MonoBehaviour:
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
   m_PixelsPerUnitMultiplier: 1
+--- !u!1 &5573019787463333269
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 5476494592397253505}
+  - component: {fileID: 2103455542652211877}
+  - component: {fileID: 3099938948812658558}
+  m_Layer: 5
+  m_Name: tipsText
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &5476494592397253505
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5573019787463333269}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 1830498978117052941}
+  m_RootOrder: 10
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 279.4, y: -98.099976}
+  m_SizeDelta: {x: 145, y: 22}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &2103455542652211877
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5573019787463333269}
+  m_CullTransparentMesh: 1
+--- !u!114 &3099938948812658558
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 5573019787463333269}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 0.9454185, b: 0, a: 1}
+  m_RaycastTarget: 0
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_FontData:
+    m_Font: {fileID: 12800000, guid: 85c13d115126ca04ca985ec0156f4c61, type: 3}
+    m_FontSize: 12
+    m_FontStyle: 1
+    m_BestFit: 0
+    m_MinSize: 1
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: "\u67E5\u8BE2\u65F6\u95F4\u4E0D\u80FD\u8D85\u8FC7183\u5929!"
 --- !u!1 &5582864527916945417
 GameObject:
   m_ObjectHideFlags: 0

+ 1 - 0
Assets/Scripts/HttpHelper.cs

@@ -1344,6 +1344,7 @@ public class HttpHelper : MonoBehaviour
         UnityWebRequest www = new UnityWebRequest(cmdUrl, "Get");
         www.downloadHandler = new DownloadHandlerBuffer();
         www.SetRequestHeader("Content-Type", "application/json");
+        Debug.Log("send:"+cmdUrl);
         await www.SendWebRequest();
         if (www.result != UnityWebRequest.Result.Success)
         {

+ 8 - 2
Assets/Scripts/UI/UIView/GCJK/DeviceTrendPanel.cs

@@ -19,7 +19,8 @@ public class DeviceTrendPanel : MonoBehaviour
     public Button closeButton;
     public Button resetButton;
     public Button checkButton;
-
+    
+    public Text tipsText;
 
     public DatePickerDropDownTextMeshPro DatePicker_Start;
     public DatePickerDropDownTextMeshPro DatePicker_End;
@@ -39,6 +40,9 @@ public class DeviceTrendPanel : MonoBehaviour
         nameText = this.transform.Find("nameText").GetComponent<Text>();
 
         checkButton = this.transform.Find("CheckButton").GetComponent<Button>();
+
+        tipsText = this.transform.Find("tipsText").GetComponent<Text>();
+        tipsText.enabled = false;
         checkButton.onClick.AddListener(() => { GetData(); });
         closeButton.onClick.AddListener(() => { Hide(); });
     }
@@ -73,9 +77,11 @@ public class DeviceTrendPanel : MonoBehaviour
             {
                 Debug.Log("时间间隔大于6个月");
                 checkButton.gameObject.SetActive(false);
+                tipsText.enabled = true;
             }
             else
             {
+                tipsText.enabled = false;
                 checkButton.gameObject.SetActive(true);
             }
         }
@@ -107,7 +113,7 @@ public class DeviceTrendPanel : MonoBehaviour
                 break;
         }
 
-        XAxis tempXaxis = _LineChart.GetChartComponent<XAxis>();
+        YAxis tempXaxis = _LineChart.GetChartComponent<YAxis>();
         tempXaxis.axisName.name = typeText;
         nameText.text = $"{name} {typeText}趋势";
         this.gameObject.SetActive(true);