using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using XCharts.Runtime; public class SheBeiShiShiType : UpdateManager { public Text runtext; public Text guzhangtext; public Text daijitext; public Text lixiantext; public RingChart runrc; public RingChart guzhangrc; public RingChart daijirc; public RingChart lixianrc; override public void updateData() { 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] = int.Parse(msg["data"]["run"].ToString()); data1.data[1] = total; runtext.text = msg["data"]["run"].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 = guzhangrc.series[0].GetSerieData(0); data3.data[0] = int.Parse(msg["data"]["fault"].ToString()); data3.data[1] = total; guzhangtext.text = msg["data"]["fault"].ToString()+"台"; SerieData data4 = lixianrc.series[0].GetSerieData(0); data4.data[0] = int.Parse(msg["data"]["offline"].ToString()); data4.data[1] = total; lixiantext.text = msg["data"]["offline"].ToString()+"台"; }); } }