예제 #1
0
        private void xianshiLED_Resize(object sender, EventArgs e)
        {
            xianshiLED fr = new xianshiLED();

            gaugeControl1.Width  = this.Width / 2 - 4;
            gaugeControl1.Height = this.Height / 3 - 5;
            gaugeControl2.Width  = this.Width / 2 - 4;
            gaugeControl2.Height = this.Height / 3 - 5;
            int y2 = gaugeControl2.Location.Y;

            this.gaugeControl2.Location = new Point(gaugeControl1.Width + 6, y2);

            gaugeControl5.Width    = this.Width - 4;
            gaugeControl5.Height   = this.Height / 3;
            gaugeControl5.Location = new Point(gaugeControl5.Location.X, this.Height / 3);

            gaugeControl3.Width    = this.Width / 2 - 4;
            gaugeControl3.Height   = this.Height / 3 - 5;
            gaugeControl3.Location = new Point(gaugeControl3.Location.X, this.Height - gaugeControl3.Height - 3);

            gaugeControl4.Width    = this.Width / 2 - 4;
            gaugeControl4.Height   = this.Height / 3 - 5;
            gaugeControl4.Location = new Point(gaugeControl3.Width + 6, this.Height - gaugeControl4.Height - 3);
        }
예제 #2
0
        /// <summary>
        /// 实验开车称重实验按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonX9_Click(object sender, EventArgs e)
        {
            //  checkBoxX3
            int chengzhong_num = 0;

            if (chengzhong_chetou == 0)
            {
                MessageBox.Show("请选择车头方向!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }
            dataGridView1.Rows.Clear();
            dataGridView1.Rows.Add(8);
            for (int i = 0; i < 8; i++)
            {
                dataGridView1.Rows[i].Visible = true;
            }
            #region 循环判断方法
            foreach (Control c in panelEx8.Controls)
            {
                if (c is DevComponents.DotNetBar.Controls.CheckBoxX && ((DevComponents.DotNetBar.Controls.CheckBoxX)c).Checked == true)
                {
                    if (int.Parse(c.Tag.ToString()) % 2 != 0)
                    {     //奇数
                        if (chengzhong_chetou == 1)
                        { //车头超前
                            string     a  = "xianshiLED" + c.Tag.ToString();
                            xianshiLED xs = (xianshiLED)panelEx8.Controls.Find(a, true)[0];
                            dataGridView1.Rows[((int.Parse(c.Tag.ToString()) + 1) / 2) - 1].Cells[2].Value = xs.b_text5.ToString();
                        }
                        else
                        {//车头朝后
                            string     a  = "xianshiLED" + c.Tag.ToString();
                            xianshiLED xs = (xianshiLED)panelEx8.Controls.Find(a, true)[0];
                            dataGridView1.Rows[((int.Parse(c.Tag.ToString()) + 1) / 2) - 1].Cells[1].Value = xs.b_text5.ToString();
                        }
                    }
                    else
                    {     //偶数
                        if (chengzhong_chetou == 1)
                        { //车头超前
                            string     a  = "xianshiLED" + c.Tag.ToString();
                            xianshiLED xs = (xianshiLED)panelEx8.Controls.Find(a, true)[0];
                            dataGridView1.Rows[(int.Parse(c.Tag.ToString()) / 2) - 1].Cells[1].Value = xs.b_text5.ToString();
                        }
                        else
                        {//车头朝后
                            string     a  = "xianshiLED" + c.Tag.ToString();
                            xianshiLED xs = (xianshiLED)panelEx8.Controls.Find(a, true)[0];
                            dataGridView1.Rows[(int.Parse(c.Tag.ToString()) / 2) - 1].Cells[2].Value = xs.b_text5.ToString();
                        }
                    }
                    chengzhong_num++;
                    // dataGridView1.Rows[i].Cells[3].Value = ad.mod_value[i][a].ToString();
                }
            }
            #endregion


            if (chengzhong_num == 0)
            {
                MessageBox.Show("请最少选择1块平板!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
            }
            chengzhong_jishuan();
        }