/// <summary> /// 年月日变更 /// </summary> /// <param name="t">时间参数,year=0,month=1,day=2</param> public void SwichToggle(int t) { //清空所有列表 dataIdList.Clear(); dataList.Clear(); dataNameList.Clear(); dataPassRateList.Clear(); //重新从数据中取值 dataList = DataGetter.Instance.dataIO.GetData_ProductPassRateList(t); for (int i = 0; i < dataList.Count; i++) { AnalysisData(dataList[i]); } //重新赋值 SetData(); }
void GetData() { //圈角度的确定 Rotation(97 ~ -263) ===> (0 ~ 360) ===> (0 ~ 100) // circleGF.rotation = Quaternion.Euler(0, 0, r0 - (mf * receiveData.DownloadData("genePowerRate", "strpvGenePercent"))); // circleCN.rotation = Quaternion.Euler(0, 0, r0 - (mf * receiveData.DownloadData("genePowerRate", "strseGenePercent"))); // circleDW.rotation = Quaternion.Euler(0, 0, r0 - (mf * receiveData.DownloadData("genePowerRate", "strpnGenePercent"))); //清空 sliceValuesCN.Clear(); sliceValuesDW.Clear(); sliceValuesGF.Clear(); pieGraphGF.sliceValues.Clear(); pieGraphCN.sliceValues.Clear(); pieGraphDW.sliceValues.Clear(); GF_Percent.text = ""; CN_Percent.text = ""; DW_Percent.text = ""; GF.text = ""; CN.text = ""; DW.text = ""; //赋值 sliceValuesGF.Add(receiveData.DownloadData("genePowerRate", "strpvGenePercent")); sliceValuesGF.Add(100 - receiveData.DownloadData("genePowerRate", "strpvGenePercent")); sliceValuesCN.Add(receiveData.DownloadData("genePowerRate", "strseGenePercent")); sliceValuesCN.Add(100 - receiveData.DownloadData("genePowerRate", "strseGenePercent")); sliceValuesDW.Add(receiveData.DownloadData("genePowerRate", "strpnGenePercent")); sliceValuesDW.Add(100 - receiveData.DownloadData("genePowerRate", "strpnGenePercent")); pieGraphGF.sliceValues.SetList(sliceValuesGF); pieGraphCN.sliceValues.SetList(sliceValuesCN); pieGraphDW.sliceValues.SetList(sliceValuesDW); GF_Percent.text = receiveData.ReturnData("genePowerRate", "strpvGenePercent") + "%"; CN_Percent.text = receiveData.ReturnData("genePowerRate", "strseGenePercent") + "%"; DW_Percent.text = receiveData.ReturnData("genePowerRate", "strpnGenePercent") + "%"; GF.text = receiveData.ReturnData("genePowerRate", "photovoltaicGenerate") + "kWh"; CN.text = receiveData.ReturnData("genePowerRate", "storedEnergyGenerate") + "kWh"; DW.text = receiveData.ReturnData("genePowerRate", "powerNetworkGenerate") + "kWh"; pieGraphGF.Refresh(); pieGraphCN.Refresh(); pieGraphDW.Refresh(); }
public void fillGraphData() { WMG_Series series = graph.lineSeries[0].GetComponent <WMG_Series>(); series.seriesName = "GDP"; // should come from obj graph.graphTitleString = "GDP"; series.pointColor = Color.cyan; graph.yAxis.AxisMaxValue = history.Max() * 1.1f; graph.yAxis.AxisMinValue = history.Min() * 0.9f; graph.xAxis.AxisMaxValue = history.Count; graph.xAxis.AxisMinValue = 1; WMG_List <Vector2> pointValues = series.pointValues; pointValues.Clear(); float x = 0; for (int i = 0; i < history.Count; i++) { pointValues.Add(new Vector2(x++, history.Get(i))); } graph.Refresh(); }
void GetData() { sliceLabels.Clear(); sliceValues.Clear(); sliceColors.Clear(); //设置序列名、数值(会自动求比例的)、颜色 sliceLabels.Add("动力"); sliceLabels.Add("充电"); sliceLabels.Add("空调"); sliceLabels.Add("其他"); sliceLabels.Add("照明"); sliceLabels.Add("储能"); sliceValues.Add(receiveData.DownloadData("usePowerRate", "power")); sliceValues.Add(receiveData.DownloadData("usePowerRate", "charge")); sliceValues.Add(receiveData.DownloadData("usePowerRate", "airConditioner")); sliceValues.Add(receiveData.DownloadData("usePowerRate", "others")); sliceValues.Add(receiveData.DownloadData("usePowerRate", "lighting")); sliceValues.Add(receiveData.DownloadData("usePowerRate", "storedEnergy")); sliceColors.Add(new Color32(86, 186, 255, 255)); sliceColors.Add(new Color32(123, 223, 252, 255)); sliceColors.Add(new Color32(86, 186, 255, 255)); sliceColors.Add(new Color32(123, 223, 252, 255)); sliceColors.Add(new Color32(86, 186, 255, 255)); sliceColors.Add(new Color32(123, 223, 252, 255)); pieGraph.sliceValues.SetList(sliceValues); pieGraph.sliceLabels.SetList(sliceLabels); pieGraph.sliceColors.SetList(sliceColors); }
void GetData() { pointvalues1.Clear(); xAxisLabels.Clear(); receiveData.PowerSys("powerDistriSystem"); todayUsePowerAmount.text = float.Parse(receiveData.powerData[receiveData.powerData.Count - 13]).ToString("f1") + "kWh"; nowLoad.text = float.Parse(receiveData.powerData[receiveData.powerData.Count - 11]).ToString("f1") + "kW"; todayPowerMoney.text = float.Parse(receiveData.powerData[receiveData.powerData.Count - 9]).ToString("f1") + "元"; float max = 0; for (int i = 2; i <= receiveData.powerData.Count - 17; i += 4) { xAxisLabels.Add(receiveData.powerData[i]); //添加x坐标 pointvalues1.Add(new Vector2(float.Parse(receiveData.powerData[i]), float.Parse(float.Parse(receiveData.powerData[i + 2]).ToString("0")))); float num = float.Parse(float.Parse(receiveData.powerData[i + 2]).ToString("0")); if (max <= num) { max = num; if (max <= 10) { max = 10; } else if (max > 10 && max <= 15) { max = 15f; } else if (max > 15 && max <= 30) { max = 30f; } else if (max > 30 && max <= 50) { max = 50f; } else if (max > 50 && max <= 100) { max = 100f; } else if (max > 100 && max <= 150) { max = 150f; } else if (max > 150 && max <= 200) { max = 200; } else if (max > 200 && max <= 250) { max = 250f; } else if (max > 250 && max <= 300) { max = 300f; } else { max = num; } barGraph.yAxis.AxisMaxValue = max; } } barGraph.xAxis.axisLabels.SetList(xAxisLabels); //把横坐标显示出来 series1.pointValues.SetList(pointvalues1); //把图显示出来 series1.pointColor = new Color32(86, 186, 255, 255); //标记点的颜色 barGraph.Refresh(); Invoke("FengXi", 0.5f); }
private void GetData() { pointvalues1.Clear(); xAxisLabels.Clear(); receiveData.PhotovoltaicWall("pvWall"); todayGeneEnergy.text = float.Parse(receiveData.photovoltaicWall[2]).ToString("0.0") + "kWh"; nowPower.text = float.Parse(receiveData.photovoltaicWall[4]).ToString("0.0") + "kW"; todayEqualHour.text = float.Parse(receiveData.photovoltaicWall[6]).ToString("0.0") + "h"; todayGenePowerProfit.text = float.Parse(receiveData.photovoltaicWall[8]).ToString("0.0") + "元"; float max = 0; for (int i = 27; i <= 99; i += 4) { xAxisLabels.Add(receiveData.photovoltaicWall[i]); //添加x坐标 pointvalues1.Add(new Vector2(float.Parse(receiveData.photovoltaicWall[i]), float.Parse(float.Parse(receiveData.photovoltaicWall[i + 2]).ToString("0")))); float num = float.Parse(float.Parse(receiveData.photovoltaicWall[i + 2]).ToString("0")); if (max <= num) { max = num; if (max <= 10) { max = 10; } else if (max > 10 && max <= 15) { max = 15f; } else if (max > 15 && max <= 30) { max = 30f; } else if (max > 30 && max <= 50) { max = 50f; } else if (max > 50 && max <= 100) { max = 100f; } else if (max > 100 && max <= 150) { max = 150f; } else if (max > 150 && max <= 200) { max = 200; } else if (max > 200 && max <= 250) { max = 250f; } else if (max > 250 && max <= 300) { max = 300f; } else { max = num; } barGraph.yAxis.AxisMaxValue = max; } } barGraph.xAxis.axisLabels.SetList(xAxisLabels); //把横坐标显示出来 series1.pointValues.SetList(pointvalues1); //把图显示出来 series1.pointColor = new Color32(86, 186, 255, 255); //标记点的颜色 barGraph.Refresh(); Invoke("FengXi", 0.5f); }
private void GetData() { pointvalues1.Clear(); xAxisLabels.Clear(); receiveData.ChargePile("chargePileAndFile"); amountOfchargeText.text = float.Parse(receiveData.chargeData[4]).ToString("0.0") + "kWh"; costOfChargeText.text = float.Parse(receiveData.chargeData[6]).ToString("0.0") + "元"; float max = 0; for (int i = 9; i < receiveData.chargeData.Count; i += 4) { xAxisLabels.Add(receiveData.chargeData[i]); //添加x坐标 pointvalues1.Add(new Vector2(float.Parse(receiveData.chargeData[i]), float.Parse(float.Parse(receiveData.chargeData[i + 2]).ToString("0")))); float num = float.Parse(float.Parse(receiveData.chargeData[i + 2]).ToString("0")); if (max <= num) //y轴动态设置 { max = num; if (max <= 10) { max = 10; } else if (max > 10 && max <= 15) { max = 15f; } else if (max > 15 && max <= 30) { max = 30f; } else if (max > 30 && max <= 50) { max = 50f; } else if (max > 50 && max <= 100) { max = 100f; } else if (max > 100 && max <= 150) { max = 150f; } else if (max > 150 && max <= 200) { max = 200; } else if (max > 200 && max <= 250) { max = 250f; } else if (max > 250 && max <= 300) { max = 300f; } else { max = num; } lineGraph.yAxis.AxisMaxValue = max; } } lineGraph.xAxis.axisLabels.SetList(xAxisLabels); //把横坐标显示出来 series1.pointValues.SetList(pointvalues1); //把图显示出来 series1.pointColor = new Color32(86, 186, 255, 255); //标记点的颜色 lineGraph.Refresh(); Invoke("FengXi", 0.5f); }
void GetData() { pointvalues1.Clear(); xAxisLabels.Clear(); receiveData.AirConditoner("meetingRoomCondition"); todayUseAmount.text = float.Parse(receiveData.airData[2]).ToString("f1") + "kWh"; nowTemperature.text = float.Parse(receiveData.airData[4]).ToString("f1") + "℃"; nowPower.text = float.Parse(receiveData.airData[6]).ToString("f1") + "kW"; setTemperature.text = float.Parse(receiveData.airData[8]).ToString("f1") + "℃"; nowState.text = receiveData.airData[10].ToString(); float max = 0; for (int i = 13; i <= 106; i += 4) { xAxisLabels.Add(receiveData.airData[i]); //添加x坐标 pointvalues1.Add(new Vector2(float.Parse(receiveData.airData[i]), float.Parse(float.Parse(receiveData.airData[i + 2]).ToString("0")))); float num = float.Parse(float.Parse(receiveData.airData[i + 2]).ToString("0")); if (max <= num) { max = num; if (max <= 10) { max = 10; } else if (max > 10 && max <= 15) { max = 15f; } else if (max > 15 && max <= 30) { max = 30f; } else if (max > 30 && max <= 50) { max = 50f; } else if (max > 50 && max <= 100) { max = 100f; } else if (max > 100 && max <= 150) { max = 150f; } else if (max > 150 && max <= 200) { max = 200; } else if (max > 200 && max <= 250) { max = 250f; } else if (max > 250 && max <= 300) { max = 300f; } else { max = num; } barGraph.yAxis.AxisMaxValue = max; } } barGraph.xAxis.axisLabels.SetList(xAxisLabels); //把横坐标显示出来 series1.pointValues.SetList(pointvalues1); //把图显示出来 series1.pointColor = new Color32(86, 186, 255, 255); //标记点的颜色 barGraph.Refresh(); Invoke("FengXi", 0.5f); }
void GetData() { pointvalues1.Clear(); xAxisLabels.Clear(); receiveData.Storage("chargeDisAmount"); todayCharge.text = float.Parse(receiveData.storageData[1]).ToString("f1") + "kWh"; todayOutputEnergy.text = float.Parse(receiveData.storageData[3]).ToString("f1") + "kWh"; nowChargeDisPower.text = float.Parse(receiveData.storageData[5]).ToString("f1") + "kW"; todaySaveMoney.text = float.Parse(receiveData.storageData[7]).ToString("f1") + "元"; float max = 0; for (int i = 10; i <= receiveData.storageData.Count; i += 4) { xAxisLabels.Add(receiveData.storageData[i]); //添加x坐标 pointvalues1.Add(new Vector2(float.Parse(receiveData.storageData[i]), float.Parse(float.Parse(receiveData.storageData[i + 2]).ToString("0")))); float num = System.Math.Abs(float.Parse(float.Parse(receiveData.storageData[i + 2]).ToString("0"))); if (max <= num) { max = num; if (max <= 10) { max = 10; } else if (max > 10 && max <= 15) { max = 15f; } else if (max > 15 && max <= 30) { max = 30f; } else if (max > 30 && max <= 50) { max = 50f; } else if (max > 50 && max <= 100) { max = 100f; } else if (max > 100 && max <= 150) { max = 150f; } else if (max > 150 && max <= 200) { max = 200; } else if (max > 200 && max <= 250) { max = 250f; } else if (max > 250 && max <= 300) { max = 300f; } else { max = num; } barGraph.yAxis.AxisMaxValue = max; barGraph.yAxis.AxisMinValue = -max; } } barGraph.xAxis.axisLabels.SetList(xAxisLabels); //把横坐标显示出来 series1.pointValues.SetList(pointvalues1); //把图显示出来 series1.pointColor = new Color32(86, 186, 255, 255); //标记点的颜色 barGraph.Refresh(); Invoke("FengXi", 0.5f); }
//数据接入 private void GetData() { pointvalues1.Clear(); xAxisLabels.Clear(); receiveData.GenerationData("geneCapacityPower"); // int j = 122; // x轴从4~22点开始 float max = 0; for (int i = 2; i < receiveData.geneData.Count; i += 4) { barGraph.xAxis.AxisNumTicks = int.Parse(receiveData.geneData[i]) - 3; xAxisLabels.Add(float.Parse(receiveData.geneData[i]).ToString("0")); pointvalues1.Add(new Vector2(float.Parse(receiveData.geneData[i]), float.Parse(receiveData.geneData[i + 2]))); float num = float.Parse(receiveData.geneData[i + 2]); if (max < num) { max = num; if (max <= 10) { max = 10; } else if (max > 10 && max <= 15) { max = 15f; } else if (max > 15 && max <= 30) { max = 30f; } else if (max > 30 && max <= 50) { max = 50f; } else if (max > 50 && max <= 100) { max = 100f; } else if (max > 100 && max <= 150) { max = 150f; } else if (max > 150 && max <= 200) { max = 200; } else if (max > 200 && max <= 250) { max = 250f; } else if (max > 250 && max <= 300) { max = 300f; } else { max = num; } barGraph.yAxis.AxisMaxValue = max; } } barGraph.xAxis.axisLabels.SetList(xAxisLabels); //把横坐标显示出来 series1.pointValues.SetList(pointvalues1); //把图显示出来 series1.pointColor = new Color32(86, 186, 255, 255); //标记点的颜色 barGraph.Refresh(); }