Exemplo n.º 1
0
        private void btnLSRRead1_Click(object sender, EventArgs e)
        {
            this.lsrList1.GridLines     = true;                        //显示表格线
            this.lsrList1.View          = View.Details;                //显示表格细节
            this.lsrList1.LabelEdit     = false;                       //是否可编辑,ListView只可编辑第一列。
            this.lsrList1.Scrollable    = true;                        //有滚动条
            this.lsrList1.HeaderStyle   = ColumnHeaderStyle.Clickable; //对表头进行设置
            this.lsrList1.FullRowSelect = true;                        //是否可以选择行

            lsrList1.Columns.Clear();

            //读取数据
            byte[] readByte = CDll.BaseTestReadData(0, basePath1.Text, "LSR");

            this.lsrList1.Columns.Add("FIFOERR", 70);
            this.lsrList1.Columns.Add("TEMT", 50);
            this.lsrList1.Columns.Add("THRE", 50);
            this.lsrList1.Columns.Add("BI", 36);
            this.lsrList1.Columns.Add("FE", 36);
            this.lsrList1.Columns.Add("PE", 36);
            this.lsrList1.Columns.Add("OE", 36);
            this.lsrList1.Columns.Add("DR", 36);

            ListViewItem[] p   = new ListViewItem[1];
            string[]       ass = new string[8] {
                "", "", "", "", "", "", "", ""
            };

            //添加

            {
                ass[7] = ((readByte[5] & 0x01)).ToString();
                ass[6] = ((readByte[5] & 0x02) >> 1).ToString();
                ass[5] = ((readByte[5] & 0x04) >> 2).ToString();
                ass[4] = ((readByte[5] & 0x08) >> 3).ToString();
                ass[3] = ((readByte[5] & 0x10) >> 4).ToString();
                ass[2] = ((readByte[5] & 0x20) >> 5).ToString();
                ass[1] = ((readByte[5] & 0x40) >> 6).ToString();
                ass[0] = ((readByte[5] & 0x80) >> 7).ToString();
            }
            p[0] = new ListViewItem(ass);

            if (lsrList1.Items.Count > 0)
            {
                this.lsrList1.Items.Remove(this.lsrList1.Items[0]);
            }

            this.lsrList1.Items.AddRange(p);
        }
Exemplo n.º 2
0
        private void btnIIRRead2_Click(object sender, EventArgs e)
        {
            this.iirList2.GridLines     = true;                        //显示表格线
            this.iirList2.View          = View.Details;                //显示表格细节
            this.iirList2.LabelEdit     = false;                       //是否可编辑,ListView只可编辑第一列。
            this.iirList2.Scrollable    = true;                        //有滚动条
            this.iirList2.HeaderStyle   = ColumnHeaderStyle.Clickable; //对表头进行设置
            this.iirList2.FullRowSelect = true;                        //是否可以选择行

            iirList2.Columns.Clear();

            //读取数据
            byte[] readByte = CDll.BaseTestReadData(1, basePath2.Text, "IIR");


            this.iirList2.Columns.Add("FIFOE", 60);
            this.iirList2.Columns.Add("FIFOE", 60);
            this.iirList2.Columns.Add("ID4", 40);
            this.iirList2.Columns.Add("ID3", 40);
            this.iirList2.Columns.Add("ID2", 40);
            this.iirList2.Columns.Add("ID1", 40);
            this.iirList2.Columns.Add("ID0", 40);
            this.iirList2.Columns.Add("NINT", 45);

            ListViewItem[] p   = new ListViewItem[1];
            string[]       ass = new string[8] {
                "", "", "", "", "", "", "", ""
            };

            //添加
            {
                ass[7] = ((readByte[5] & 0x01)).ToString();
                ass[6] = ((readByte[5] & 0x02) >> 1).ToString();
                ass[5] = ((readByte[5] & 0x04) >> 2).ToString();
                ass[4] = ((readByte[5] & 0x08) >> 3).ToString();
                ass[3] = ((readByte[5] & 0x10) >> 4).ToString();
                ass[2] = ((readByte[5] & 0x20) >> 5).ToString();
                ass[1] = ((readByte[5] & 0x40) >> 6).ToString();
                ass[0] = ((readByte[5] & 0x80) >> 7).ToString();
            }

            p[0] = new ListViewItem(ass);

            if (iirList2.Items.Count > 0)
            {
                this.iirList2.Items.Remove(this.iirList2.Items[0]);
            }
            this.iirList2.Items.AddRange(p);
        }
Exemplo n.º 3
0
        private void btnRead2_Click(object sender, EventArgs e)
        {
            this.list2.GridLines     = true;                        //显示表格线
            this.list2.View          = View.Details;                //显示表格细节
            this.list2.LabelEdit     = false;                       //是否可编辑,ListView只可编辑第一列。
            this.list2.Scrollable    = true;                        //有滚动条
            this.list2.HeaderStyle   = ColumnHeaderStyle.Clickable; //对表头进行设置
            this.list2.FullRowSelect = true;                        //是否可以选择行

            list2.Columns.Clear();

            //读取数据
            byte[] readByte = CDll.BaseTestReadData(1, basePath2.Text, "ARM");

            this.list2.Columns.Add("RXRDY", 125);
            this.list2.Columns.Add("TXRDY", 125);
            this.list2.Columns.Add("IRQ", 125);


            ListViewItem[] p   = new ListViewItem[1];
            string[]       ass = new string[3] {
                "", "", ""
            };

            //添加
            {
                ass[2] = ((readByte[4] & 0x01)).ToString();
                ass[1] = ((readByte[4] & 0x02) >> 1).ToString();
                ass[0] = ((readByte[4] & 0x04) >> 2).ToString();
            }
            p[0] = new ListViewItem(ass);
            if (list2.Items.Count > 0)
            {
                this.list2.Items.Remove(this.list2.Items[0]);
            }
            this.list2.Items.AddRange(p);
        }
Exemplo n.º 4
0
 private void baseRead2_Click(object sender, EventArgs e)
 {
     byte[] readByte = CDll.BaseTestReadData(1, basePath2.Text, "BASE");
     receiveData2.Text = ((int)readByte[4]).ToString();
 }