|
@@ -138,9 +138,12 @@ public class SWYJLayer : YZTRootLayer
|
|
public ShuiWeiCtrl swXY;
|
|
public ShuiWeiCtrl swXY;
|
|
|
|
|
|
public Text title;
|
|
public Text title;
|
|
|
|
+
|
|
|
|
+ public Dropdown dropdown;
|
|
private void Awake()
|
|
private void Awake()
|
|
{
|
|
{
|
|
Init();
|
|
Init();
|
|
|
|
+ dropdown.ClearOptions();
|
|
BuYuanDataButton = this.transform.Find("Main/BuYuanButton").GetComponent<Button>();
|
|
BuYuanDataButton = this.transform.Find("Main/BuYuanButton").GetComponent<Button>();
|
|
BuYuanDataButton.onClick.AddListener(() =>
|
|
BuYuanDataButton.onClick.AddListener(() =>
|
|
{
|
|
{
|
|
@@ -178,48 +181,31 @@ public class SWYJLayer : YZTRootLayer
|
|
|
|
|
|
void InitSWZData()
|
|
void InitSWZData()
|
|
{
|
|
{
|
|
- if (GlobalData.qXZDatas.Count < 1 || GlobalData.qXZDatas1h.Count < 1)
|
|
|
|
|
|
+ if (GlobalData.sWZDatas.Count < 1 || GlobalData.sWZDatas6H.Count < 1)
|
|
return;
|
|
return;
|
|
|
|
|
|
- float total24Value = 0;
|
|
|
|
- float max24Value = float.MinValue;
|
|
|
|
- float avg24Value = 0;
|
|
|
|
- float xtValue = 0;
|
|
|
|
- for (int i = 0; i < GlobalData.qXZDatas.Count; i++)
|
|
|
|
- {
|
|
|
|
- if (GlobalData.qXZDatas[i].STNM.Contains("新滩"))
|
|
|
|
- {
|
|
|
|
- xtValue = GlobalData.qXZDatas[i].dropSum6;
|
|
|
|
- }
|
|
|
|
- total24Value += GlobalData.qXZDatas[i].dropSum6;
|
|
|
|
- max24Value = MathF.Max(max24Value, GlobalData.qXZDatas[i].dropSum6);
|
|
|
|
|
|
+ dropdown.ClearOptions();
|
|
|
|
+ List<Dropdown.OptionData> data = new List<Dropdown.OptionData>();
|
|
|
|
+ for (int i = 0; i < GlobalData.sWZDatas.Count; i++) {
|
|
|
|
+ data.Add(new Dropdown.OptionData(GlobalData.sWZDatas[i].STNM.Trim()));
|
|
}
|
|
}
|
|
|
|
+ dropdown.AddOptions(data);
|
|
|
|
|
|
- avg24Value = total24Value / GlobalData.qXZDatas.Count;
|
|
|
|
-
|
|
|
|
- float total1Value = 0;
|
|
|
|
- float max1Value = float.MinValue;
|
|
|
|
- float avg1Value = 0;
|
|
|
|
-
|
|
|
|
- for (int i = 0; i < GlobalData.qXZDatas1h.Count; i++)
|
|
|
|
|
|
+ dropdown.onValueChanged.RemoveAllListeners();
|
|
|
|
+ dropdown.onValueChanged.AddListener((int index) =>
|
|
{
|
|
{
|
|
- total1Value += GlobalData.qXZDatas1h[i].dropSum6;
|
|
|
|
- max1Value = MathF.Max(max1Value, GlobalData.qXZDatas1h[i].dropSum6);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- avg1Value = total1Value / GlobalData.qXZDatas.Count;
|
|
|
|
-
|
|
|
|
|
|
+ _dangQianYuLiangText.text =
|
|
|
|
+ $"{GlobalData.sWZDatas6H[index].dropSum6} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
+ _zuiDaYuLiangText.text =
|
|
|
|
+ $"{GlobalData.sWZDatas[index].dropSum6} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
+ _weatherTypeText.text = $"{GlobalData.sWZDatas[index].STNM.Trim()}";
|
|
|
|
+ });
|
|
|
|
|
|
_dangQianYuLiangText.text =
|
|
_dangQianYuLiangText.text =
|
|
- $"{max1Value.ToString("0.00")} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
|
|
+ $"{GlobalData.sWZDatas6H[0].dropSum6} <size=14><color=#A5BBE2>mm</color></size>";
|
|
_zuiDaYuLiangText.text =
|
|
_zuiDaYuLiangText.text =
|
|
- $"{max24Value.ToString("0.00")} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
- _pingJunYuLiangText.text =
|
|
|
|
- $"{avg1Value.ToString("0.00")} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
- _chaoJingZhanDianText.text =
|
|
|
|
- $"{avg24Value.ToString("0.00")} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
-
|
|
|
|
- _weatherTypeText.text = $"{xtValue} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
|
|
+ $"{GlobalData.sWZDatas[0].dropSum6} <size=14><color=#A5BBE2>mm</color></size>";
|
|
|
|
+ _weatherTypeText.text = $"{GlobalData.sWZDatas[0].STNM.Trim()}";
|
|
//todo 换图标
|
|
//todo 换图标
|
|
}
|
|
}
|
|
|
|
|
|
@@ -384,7 +370,7 @@ public class SWYJLayer : YZTRootLayer
|
|
_zuiDaYuLiangText = this.transform.Find("Left/QuanYuYuLiang/ZuiDaYuLiang/numText").GetComponent<Text>();
|
|
_zuiDaYuLiangText = this.transform.Find("Left/QuanYuYuLiang/ZuiDaYuLiang/numText").GetComponent<Text>();
|
|
_pingJunYuLiangText = this.transform.Find("Left/QuanYuYuLiang/PingJunYuLiang/numText").GetComponent<Text>();
|
|
_pingJunYuLiangText = this.transform.Find("Left/QuanYuYuLiang/PingJunYuLiang/numText").GetComponent<Text>();
|
|
_chaoJingZhanDianText = this.transform.Find("Left/QuanYuYuLiang/ChaoZhanYuJing/numText").GetComponent<Text>();
|
|
_chaoJingZhanDianText = this.transform.Find("Left/QuanYuYuLiang/ChaoZhanYuJing/numText").GetComponent<Text>();
|
|
- _weatherTypeText = this.transform.Find("Left/QuanYuYuLiang/weatherTypeValue").GetComponent<Text>();
|
|
|
|
|
|
+ _weatherTypeText = this.transform.Find("Left/QuanYuYuLiang/weatherTypeName").GetComponent<Text>();
|
|
_weatherTypeIcon = this.transform.Find("Left/QuanYuYuLiang/weatherIcon").GetComponent<Image>();
|
|
_weatherTypeIcon = this.transform.Find("Left/QuanYuYuLiang/weatherIcon").GetComponent<Image>();
|
|
|
|
|
|
|
|
|