|
@@ -1,3 +1,4 @@
|
|
|
+using System;
|
|
|
using System.Collections;
|
|
|
using System.Collections.Generic;
|
|
|
using TMPro;
|
|
@@ -47,48 +48,178 @@ public class OscillateDataStatistics : MonoBehaviour
|
|
|
lineMovePoint = new List<Vector3>();
|
|
|
foreach (var item in dicTemper)
|
|
|
{
|
|
|
- listTimerStr.Add(item.Key);
|
|
|
- lineTemperaturePoint.Add(new Vector3(0, item.Value, 0));
|
|
|
+ string[] str1 = item.Key.Split(' ');
|
|
|
+ string[] str2 = str1[1].Split(':');
|
|
|
+
|
|
|
+ if (str2[1] == "00")
|
|
|
+ {
|
|
|
+ int timers = int.Parse(str2[0]);
|
|
|
+ timers++;
|
|
|
+ timers = timers % 24;
|
|
|
+ string timer;
|
|
|
+ if (timers < 10)
|
|
|
+ {
|
|
|
+ timer = "0" + timers.ToString() + ":00";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ timer = timers.ToString() + ":00";
|
|
|
+ }
|
|
|
+
|
|
|
+ listTimerStr.Add(timer);
|
|
|
+ lineTemperaturePoint.Add(new Vector3(0, item.Value, 0));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
+ Dictionary<string, Vector3> dicHumidity = new Dictionary<string, Vector3>();
|
|
|
+ List<string> listTimerStr2 = GetListTime();
|
|
|
+ List<Vector3> listTemperatureData = new List<Vector3>();
|
|
|
+ for (int i = 0; i < listTimerStr2.Count; i++)
|
|
|
+ {
|
|
|
+ bool finish = false;
|
|
|
+ for (int j = 0; j < listTimerStr.Count; j++)
|
|
|
+ {
|
|
|
+ if (listTimerStr2[i] == listTimerStr[j])
|
|
|
+ {
|
|
|
+ finish = true;
|
|
|
+ listTemperatureData.Add(lineTemperaturePoint[j]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (finish == false)
|
|
|
+ {
|
|
|
+ listTemperatureData.Add(Vector3.up);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ listTimerStr.Clear();
|
|
|
+ listTimerStr = new List<string>();
|
|
|
foreach (var item in dicSpeed)
|
|
|
{
|
|
|
- lineSpeedPoint.Add(new Vector3(0, item.Value, 0));
|
|
|
+ string[] str1 = item.Key.Split(' ');
|
|
|
+ string[] str2 = str1[1].Split(':');
|
|
|
+
|
|
|
+ if (str2[1] == "00")
|
|
|
+ {
|
|
|
+ int timers = int.Parse(str2[0]);
|
|
|
+ timers++;
|
|
|
+ timers = timers % 24;
|
|
|
+ string timer;
|
|
|
+ if (timers < 10)
|
|
|
+ {
|
|
|
+ timer = "0" + timers.ToString() + ":00";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ timer = timers.ToString() + ":00";
|
|
|
+ }
|
|
|
+
|
|
|
+ listTimerStr.Add(timer);
|
|
|
+ lineSpeedPoint.Add(new Vector3(0, item.Value, 0));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ List<Vector3> listSpeedData = new List<Vector3>();
|
|
|
+ for (int i = 0; i < listTimerStr2.Count; i++)
|
|
|
+ {
|
|
|
+ bool finish = false;
|
|
|
+ for (int j = 0; j < listTimerStr.Count; j++)
|
|
|
+ {
|
|
|
+ if (listTimerStr2[i] == listTimerStr[j])
|
|
|
+ {
|
|
|
+ finish = true;
|
|
|
+ listSpeedData.Add(lineSpeedPoint[j]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (finish == false)
|
|
|
+ {
|
|
|
+ listSpeedData.Add(Vector3.up);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ listTimerStr.Clear();
|
|
|
+ listTimerStr = new List<string>();
|
|
|
foreach (var item in dicMove)
|
|
|
{
|
|
|
- lineMovePoint.Add(new Vector3(0, item.Value, 0));
|
|
|
+ string[] str1 = item.Key.Split(' ');
|
|
|
+ string[] str2 = str1[1].Split(':');
|
|
|
+
|
|
|
+ if (str2[1] == "00")
|
|
|
+ {
|
|
|
+ int timers = int.Parse(str2[0]);
|
|
|
+ timers++;
|
|
|
+ timers = timers % 24;
|
|
|
+ string timer;
|
|
|
+ if (timers < 10)
|
|
|
+ {
|
|
|
+ timer = "0" + timers.ToString() + ":00";
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ timer = timers.ToString() + ":00";
|
|
|
+ }
|
|
|
+
|
|
|
+ listTimerStr.Add(timer);
|
|
|
+ lineMovePoint.Add(new Vector3(0, item.Value, 0));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- int num = 0;
|
|
|
- for (int i = 0; i < listTimerStr.Count; i = i + 2)
|
|
|
+ List<Vector3> listMoveData = new List<Vector3>();
|
|
|
+ for (int i = 0; i < listTimerStr2.Count; i++)
|
|
|
{
|
|
|
- string[] str = listTimerStr[i].Split(' ');
|
|
|
-
|
|
|
- // listTimeKD[num++].text = str[1];
|
|
|
- string[] str2 = str[1].Split(':');
|
|
|
- int timers = int.Parse(str2[0]);
|
|
|
- timers++;
|
|
|
- Debug.Log("DGJ ===> timers " + timers);
|
|
|
- if (timers < 10)
|
|
|
+ bool finish = false;
|
|
|
+ for (int j = 0; j < listTimerStr.Count; j++)
|
|
|
{
|
|
|
- listTimeKD[num++].text = "0" + timers.ToString() + ":00";
|
|
|
+ if (listTimerStr2[i] == listTimerStr[j])
|
|
|
+ {
|
|
|
+ finish = true;
|
|
|
+ listMoveData.Add(lineMovePoint[j]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
- else
|
|
|
+ if (finish == false)
|
|
|
{
|
|
|
- listTimeKD[num++].text = timers.ToString() + ":00";
|
|
|
+ listMoveData.Add(Vector3.up);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- DrawLine(temperatureLine, lineTemperaturePoint);
|
|
|
- DrawLine(speedLine, lineSpeedPoint);
|
|
|
- DrawLine(moveLine, lineMovePoint);
|
|
|
+ int num = 0;
|
|
|
+ for (int i = 0; i < listTimerStr2.Count; i = i + 2)
|
|
|
+ {
|
|
|
+ listTimeKD[num++].text = listTimerStr2[i];
|
|
|
+ }
|
|
|
|
|
|
- CreateMesh(speedMeshFilter, lineSpeedPoint, new Color32(255, 230, 98, 240), new Color32(255, 230, 98, 180));
|
|
|
- CreateMesh(moveMeshFilter, lineMovePoint, new Color32(27, 126, 242, 240), new Color32(27, 126, 242, 180));
|
|
|
- CreateMesh(temperatureMeshFilter, lineTemperaturePoint, new Color32(112, 238, 255, 240), new Color32(112, 238, 255, 180));
|
|
|
+ //int num = 0;
|
|
|
+ //for (int i = 0; i < listTimerStr.Count; i = i + 2)
|
|
|
+ //{
|
|
|
+ // string[] str = listTimerStr[i].Split(' ');
|
|
|
+
|
|
|
+ // // listTimeKD[num++].text = str[1];
|
|
|
+ // string[] str2 = str[1].Split(':');
|
|
|
+ // int timers = int.Parse(str2[0]);
|
|
|
+ // timers++;
|
|
|
+ // Debug.Log("DGJ ===> timers " + timers);
|
|
|
+ // if (timers < 10)
|
|
|
+ // {
|
|
|
+ // listTimeKD[num++].text = "0" + timers.ToString() + ":00";
|
|
|
+ // }
|
|
|
+ // else
|
|
|
+ // {
|
|
|
+ // listTimeKD[num++].text = timers.ToString() + ":00";
|
|
|
+ // }
|
|
|
+ //}
|
|
|
+
|
|
|
+
|
|
|
+ DrawLine(temperatureLine, listTemperatureData);
|
|
|
+ DrawLine(speedLine, listSpeedData);
|
|
|
+ DrawLine(moveLine, listMoveData);
|
|
|
+
|
|
|
+ CreateMesh(speedMeshFilter, listSpeedData, new Color32(255, 230, 98, 240), new Color32(255, 230, 98, 180));
|
|
|
+ CreateMesh(moveMeshFilter, listMoveData, new Color32(27, 126, 242, 240), new Color32(27, 126, 242, 180));
|
|
|
+ CreateMesh(temperatureMeshFilter, listTemperatureData, new Color32(112, 238, 255, 240), new Color32(112, 238, 255, 180));
|
|
|
}
|
|
|
|
|
|
public void DrawLine(LineRenderer line, List<Vector3> linePoint)
|
|
@@ -142,7 +273,7 @@ public class OscillateDataStatistics : MonoBehaviour
|
|
|
for (int i = 0; i < listVertices.Count; i++)
|
|
|
{
|
|
|
vertices[i] = listVertices[i];
|
|
|
- Debug.Log(listVertices[i].ToString());
|
|
|
+ // Debug.Log(listVertices[i].ToString());
|
|
|
}
|
|
|
|
|
|
int[] triangles = new int[listTriangles.Count];
|
|
@@ -150,7 +281,7 @@ public class OscillateDataStatistics : MonoBehaviour
|
|
|
{
|
|
|
triangles[i] = listTriangles[i];
|
|
|
|
|
|
- Debug.Log(listTriangles);
|
|
|
+ // Debug.Log(listTriangles);
|
|
|
}
|
|
|
|
|
|
Color[] colors = new Color[listcolor.Count];
|
|
@@ -168,4 +299,29 @@ public class OscillateDataStatistics : MonoBehaviour
|
|
|
|
|
|
meshFilter.mesh = mesh;
|
|
|
}
|
|
|
+
|
|
|
+ private List<string> GetListTime()
|
|
|
+ {
|
|
|
+ List<string> listTimer = new List<string>();
|
|
|
+
|
|
|
+ int hour = DateTime.Now.Hour;
|
|
|
+
|
|
|
+ for (int i = 0; i < 9; i++)
|
|
|
+ {
|
|
|
+ int hTimer = hour - 8 + i;
|
|
|
+ if (hTimer < 10)
|
|
|
+ {
|
|
|
+ listTimer.Add("0" + hTimer.ToString() + ":00");
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ listTimer.Add(hTimer.ToString() + ":00");
|
|
|
+ }
|
|
|
+
|
|
|
+ Debug.Log(listTimer[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ return listTimer;
|
|
|
+ }
|
|
|
+
|
|
|
}
|