示例#1
0
        private void ReadPointData()
        {
            int i = 0;

            string[] dat = null;
            dat = comm.ReadDMIntDat(1010);

            if (dat != null)
            {
                i = Convert.ToInt32(dat[0]);

                if (i == 0)
                {
                    i = 1;
                }
            }

            dat = comm.ReadDMDats(dm250, 4);

            if (dat != null)
            {
                point.x1 = dat[0];
                point.z1 = dat[1];
                point.y  = dat[2];
                point.x2 = dat[3];
            }

            pointsList.Add(point);

            if (pointsList.Count <= 30 && pointsList.Count > 0)
            {
                pointIndex++;
                //加载读取到的点位信息到表格中去
                dataGridView1.Rows[0].Cells[i].Value = point.x1;
                dataGridView1.Rows[1].Cells[i].Value = point.z1;
                dataGridView1.Rows[2].Cells[i].Value = point.y;
                dataGridView1.Rows[3].Cells[i].Value = point.x2;

                if (Product.CurProduct == Product.ProductEnum.Product001)
                {
                    dataGridView1.Rows[4].Cells[i].Value = point.z2;
                }
            }

            point.x1 = "";
            point.x2 = "";
            point.y  = "";
            point.x2 = "";
            point.z2 = "";
        }