コード例 #1
0
        public void Reset()
        {
            listViewData.Items.Clear();
            listViewData.Groups.Clear();
            Site st;
            int  idx = 0;

            while (sites.GetAt(idx++, out st))
            {
                ListViewGroup lvg = new ListViewGroup();
                lvg.Tag    = st;
                lvg.Header = st.name + "(" + st.num.ToString() + ")";
                lvg.Name   = st.num.ToString();
                listViewData.Groups.Add(lvg);
                Sensor ss;
                int    j = 0;
                while (st.GetAt(j++, out ss))
                {
                    ListViewItem lvi = new ListViewItem();
                    lvi.Text = "";
                    lvi.SubItems.Add(ss.name);
                    lvi.SubItems.Add(Sensor.items[ss.type]);
                    lvi.SubItems.Add("");
                    lvi.SubItems.Add(ss.alarmHigh == Decimal.MaxValue ? "" : ss.alarmHigh.ToString());
                    lvi.SubItems.Add(ss.alarmLow == Decimal.MinValue ? "" : ss.alarmLow.ToString());
                    lvi.SubItems.Add("");
                    lvg.Items.Add(lvi);
                    ListViewItem      newLvi = listViewData.Items.Add(lvi);
                    SensorDataHandler sdh    = new SensorDataHandler(st.num, ss, newLvi);
                    UiUpdater         uu     = new UiUpdater(st.num, ss.num, sdh.UpdateData);
                    sdh.uu = uu;
                }
            }
        }
コード例 #2
0
 protected override void Start()
 {
     SetUiMessage("Ready.");
     updateUI = true;
     sdh      = new SensorDataHandler();
     brick    = GameObject.Find("GreenBrick");
     base.Start();
 }