示例#1
0
        private void UpdateAllNodeStatus()
        {
            if (bOpen == false)
            {
                panel4.Visible = false;
                panel3.Visible = false;
                lb_addrfrom.Items.Clear();
                btn_open.Text = GetText("Open");
                return;
            }
            else
            {
                panel4.Visible = true;
                panel3.Visible = true;
            }
            btn_open.Text = GetText("Close");

            nodemap.Clear();
            nodestatus.Clear();
            nodelist.Clear();
            lb_addrfrom.Items.Clear();

            lb_addrfrom.Items.Add("All boards");
            nodelist.Add(0);
            byte[] tofind = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 36 };
            foreach(byte i in tofind)
            {
                SubNode n = new SubNode(sp, i);
                n.status = NodeStatus.ST_IDLE;
                n["addr"] = null;
                if (!WaitForIdleSlow(n))
                    continue;
                n["board_id"] = null;//get board typ
                if (!WaitForIdleSlow(n))
                    continue;
                string org = n["board_id"].Value.ToString();
                n["fw_rev_uw"] = null;//get revistion
                if (!WaitForIdleSlow(n))
                    continue;
                nodemap[i] = n;
                nodestatus[i] = new Pernode();
                
                string type = "Unknown";
                if(n["board_id"].Value >= 16 && n["board_id"].Value < 32)
                    type = "Weight Node";
                if(n["board_id"].Value < 16)
                    type = "Top Node    ";
                lb_addrfrom.Items.Add("Node " + i.ToString("D2") + "  ; Type: " + type + "  ; Rev: " + n["fw_rev_uw"].Value.ToString());
                nodelist.Add(i);
            }
        }
示例#2
0
        private void UpdateAllNodeStatus()
        {
            if (bOpen == false)
            {
                panel4.Visible = false;
                panel3.Visible = false;
                lb_addrfrom.Items.Clear();
                btn_open.Text = GetText("Open");
                return;
            }
            else
            {
                panel4.Visible = true;
                panel3.Visible = true;
            }
            btn_open.Text = GetText("Close");

            nodemap.Clear();
            nodestatus.Clear();
            nodelist.Clear();
            lb_addrfrom.Items.Clear();

            lb_addrfrom.Items.Add("All boards");
            nodelist.Add(0);
            byte[] tofind = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 36 };
            foreach (byte i in tofind)
            {
                SubNode n = new SubNode(sp, i);
                n.status  = NodeStatus.ST_IDLE;
                n["addr"] = null;
                if (!WaitForIdleSlow(n))
                {
                    continue;
                }
                n["board_id"] = null;//get board typ
                if (!WaitForIdleSlow(n))
                {
                    continue;
                }
                string org = n["board_id"].Value.ToString();
                n["fw_rev_uw"] = null;//get revistion
                if (!WaitForIdleSlow(n))
                {
                    continue;
                }
                nodemap[i]    = n;
                nodestatus[i] = new Pernode();

                string type = "Unknown";
                if (n["board_id"].Value >= 16 && n["board_id"].Value < 32)
                {
                    type = "Weight Node";
                }
                if (n["board_id"].Value < 16)
                {
                    type = "Top Node    ";
                }
                lb_addrfrom.Items.Add("Node " + i.ToString("D2") + "  ; Type: " + type + "  ; Rev: " + n["fw_rev_uw"].Value.ToString());
                nodelist.Add(i);
            }
        }