AR Design
UBC EML collab with UBC SALA - visualizing IoT data in AR
DataWidgetHandler.cs
Go to the documentation of this file.
1 using System;
2 using System.Collections;
3 using System.Collections.Generic;
4 using UnityEngine;
5 using UnityEngine.UI;
6 namespace ARDesign
7 {
8  namespace Widgets
9  {
13  public class DataWidgetHandler : WidgetType<DataWidget>
14  {
15 
16  [SerializeField]
17  private TextMesh label;
18  [SerializeField]
19  private Text labelText;
20  [SerializeField]
21  private Text curval;
22  [SerializeField]
23  private Text curtime;
24 
25  //TODO: get rid of this kinda asap
26  public SpriteRenderer graph;
27 
28  #region UNITY_MONOBEHAVIOUR_METHODS
29  private void Update()
30  {
31  curval.text = reader.GetCurrentValue().y.ToString();
32  DateTime time = new DateTime((long)reader.GetCurrentValue().x);
33  curtime.text = time.ToString();
34  }
35  #endregion //UNITY_MONOBEHAVIOUR_METHODS
36 
37  #region PUBLIC_METHODS
38  public void UpdateLabel()
42  {
43  label.text = reader.GetLabel();
44  labelText.text = reader.GetLabel();
45  }
46  #endregion //PUBLIC_METHODS
47  }
48  }
49 }
T reader
Reader indicates the data loading functions of the widget. Should derive from InfluxReader ...
Handler class for data displaying widgets
Typed widget handler class. Type indicates form of Widget content and should derive from InfluxReader...
void UpdateLabel()
Sets label of widget ot displat type of data