Manager.cs 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using XCharts.Runtime;
  5. public class Manager
  6. {
  7. public class UserInfo
  8. {
  9. public string count;
  10. public string name;
  11. public string dept;
  12. public string notes;
  13. public string position;
  14. public int admin;
  15. }
  16. public class Detail
  17. {
  18. public string name;
  19. public string update_rate_display;
  20. public int current_data_source;
  21. public string check_time;
  22. public int real_data_status;
  23. public int update_rate_type;
  24. public int update_Rate_value;
  25. }
  26. public class Toption
  27. {
  28. public int current_data_source;
  29. public int backup_data_switch_type;
  30. public int data_recover_type;
  31. public List<Detail> details;
  32. }
  33. public class generaloption
  34. {
  35. public int update_time_display_switch;
  36. }
  37. public class AdminsystemInfo
  38. {
  39. public generaloption general_option;
  40. public Toption yunneng_option;
  41. public Toption zongji_ption;
  42. public Toption donghuan_option;
  43. }
  44. public class TongSuanData
  45. {
  46. public float zhiji;
  47. public float serverct;
  48. public float devct;
  49. }
  50. public class JianKongPtData
  51. {
  52. public float shijianct;
  53. public float zhixingct;
  54. public float gaojingct;
  55. }
  56. public class ServerData
  57. {
  58. public List<ServerRoomData> serverList = new List<ServerRoomData>();
  59. }
  60. public class ServerRoomData
  61. {
  62. public int id;
  63. public string name;
  64. public float wendu;
  65. public float shidu;
  66. public float zonggonglv;
  67. public float shangridl;
  68. public List<ServerVideoData> videolist;
  69. public List<ServerJiLongData> jilonglist;
  70. }
  71. public class ServerVideoData
  72. {
  73. public int id;
  74. public int type;
  75. public string name;
  76. public string time;
  77. public List<string> url;
  78. }
  79. public class ServerJiLongData
  80. {
  81. public int id;
  82. public string name;
  83. public List<ServerjiguiData> jiguilist;
  84. }
  85. public class ServerjiguiData
  86. {
  87. public int id;
  88. public string name;
  89. public float zgl;
  90. public float srz;
  91. public float szz;
  92. public float syz;
  93. public float wendu;
  94. public float shidu;
  95. }
  96. public class PieChartData
  97. {
  98. public List<PieChartItemData> items;
  99. public float value;
  100. public string title;
  101. }
  102. public class PieChartItemData
  103. {
  104. public string name;
  105. public float value;
  106. }
  107. public class RingValueData
  108. {
  109. public string value;
  110. public string max;
  111. }
  112. public class GaoJingListData
  113. {
  114. public List<GaoJingItemData> list;
  115. }
  116. public class GaoJingItemData
  117. {
  118. public string lv;
  119. public string time;
  120. public string dev;
  121. public string type;
  122. }
  123. public class LineChartData
  124. {
  125. public List<string> xdata;
  126. public List<string> ydata;
  127. public List<LineChartSeriesData> sdata;
  128. }
  129. public class LineChartSeriesData
  130. {
  131. public string name;
  132. public List<float> values;
  133. }
  134. public static void setLineData(LineChart lineChart, LineChartData data)
  135. {
  136. setXValue(lineChart,data);
  137. setYValue(lineChart,data);
  138. setAllValue(lineChart,data);
  139. }
  140. static void setXValue(LineChart lineChart, LineChartData data)
  141. {
  142. XAxis x = lineChart.GetChartComponent<XAxis>();
  143. x.data = data.xdata;
  144. }
  145. static void setYValue(LineChart lineChart, LineChartData data)
  146. {
  147. YAxis y = lineChart.GetChartComponent<YAxis>();
  148. y.data = data.ydata;
  149. }
  150. static void setAllValue(LineChart lineChart, LineChartData data)
  151. {
  152. for (int i = 0; i < data.sdata.Count; i++)
  153. {
  154. if (lineChart.series.Count > i)
  155. {
  156. lineChart.series[i].serieName = data.sdata[i].name;
  157. Debug.Log(data.sdata[i].values.Count);
  158. lineChart.series[i].ClearData();
  159. for (int j = 0; j < data.sdata[i].values.Count; j++)
  160. {
  161. if (lineChart.series[i].data.Count<=j)
  162. {
  163. SerieData sd = new SerieData();
  164. sd.data = new List<double>();
  165. sd.data.Add(j);
  166. sd.data.Add(data.sdata[i].values[j]);
  167. lineChart.series[i].data.Add(sd);
  168. }
  169. else
  170. lineChart.series[i].data[j].data[1] = data.sdata[i].values[j];
  171. }
  172. }
  173. }
  174. }
  175. }