Example #1
0
        private void btnparse_Click(object sender, EventArgs e)
        {
            byte[] data = HexStringToByteArray(RtxtInput.Text);
            //解码到数据集对象
            //传输语法由构造函数传入
            DCMDataSet ds = new DCMDataSet((TransferSyntax)cbTransferSyntax.SelectedItem);
            //初始化索引
            uint idx = 0;

            //DCMDataSet解码
            ds.Decode(data, ref idx);
            //数据集转换为字符串显示
            string str = ds.ToString("");

            string[] lines = str.Split('\n');
            lvOutput.Items.Clear();
            for (int i = 0; i < lines.Length; i++)
            {
                ListViewItem item = new ListViewItem(lines[i].Split('\t'));
                lvOutput.Items.Add(item);
            }
            //根据内容设置listview大小
            for (int i = 0; i < 5; i++)
            {
                lvOutput.Columns[i].Width = -1;
            }
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            byte[] data = HexStringToByteArray(txtInput.Text);
            //解码到数据集对象
            DCMDataSet ds  = new DCMDataSet((TransferSyntax)cbTransferSyntax.SelectedItem);
            uint       idx = 0;

            ds.Decode(data, ref idx);
            //数据集转换为字符串显示
            string str = ds.ToString("");

            string[] lines = str.Split('\n');
            lvOutput.Items.Clear();
            for (int i = 0; i < lines.Length; i++)
            {
                ListViewItem item = new ListViewItem(lines[i].Split('\t'));
                lvOutput.Items.Add(item);
            }
        }