Exemplo n.º 1
0
        private void shengchengButton_Click(object sender, EventArgs e)
        {
            if (saveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                String fileName = saveFileDialog1.FileName;
                this.textBox1.Text = fileName;

                int JianCeLieShu = int.Parse((String)this.textBox2.Text);

                try
                {
                    float     inc   = 1;
                    float     start = 1;
                    float[][] v;
                    v = new float[CloneSelectionDevice.SCP_TestRowNum][];
                    for (int i = 0; i < CloneSelectionDevice.SCP_TestRowNum; i++)
                    {
                        v[i] = new float[JianCeLieShu];
                    }
                    for (int i = 0; i < CloneSelectionDevice.SCP_TestRowNum; i++)
                    {
                        for (int j = 0; j < JianCeLieShu; j++)
                        {
                            v[i][j] = start;
                            start  += inc;
                        }
                    }
                    CloneSelectFileHelper.setJianCeShuJu(fileName, v, JianCeLieShu);
                }
                catch (Exception ex)
                {
                }
            }
        }
Exemplo n.º 2
0
        private void daoRuButton_Click(object sender, EventArgs e)
        {
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                String    fileName = openFileDialog1.FileName;
                float[][] v        = CloneSelectFileHelper.getJianCeShuJu(fileName, int.Parse(textBox2.Text));
                if (v != null)
                {
                    //DeviceInfo.setDetectValues(v);
                    for (int i = 0; i < int.Parse(textBox2.Text); i++)
                    {
                        ListViewItem lvi = new ListViewItem();
                        for (int j = 0; j < CloneSelectionDevice.SCP_TestRowNum; j++)
                        {
                            lvi.SubItems.Add(v[j][i].ToString());
                        }
                        this.listView1.Items.Add(lvi);
                    }
                }

                listView1.EndUpdate();
            }
        }