예제 #1
0
        private void Show_xiangxi_Yiliu(object sender, EventArgs e)
        {
            Show_Chuangti(xiangxi_view);
            xiangxi_view.Set_Yiliu();
            YiLiuGang_Item item = (YiLiuGang_Item)sender;

            xiangxi_view.Set_Title(item.JiGang_Name);
        }
예제 #2
0
        public void ReSet_Device_Info()
        {
            // 总貌中显示设备的信息
            // 按照设备号进行排列
            for (int i = 0; i < 6; i++)
            {
                int count = tabControl1.TabPages[i].Controls.Count;

                for (int j = 0; j < count; j++)
                {
                    Control control = (Control)tabControl1.TabPages[i].Controls[0];
                    tabControl1.TabPages[i].Controls.Remove(control);
                    control.Dispose();
                }

                for (int j = 1; j <= 12; j++)
                {
                    try
                    {
                        int       machine_num = i * 12 + j;
                        string    where_cmd   = "Address='" + machine_num.ToString() + "'";
                        DataTable dt_machine  = MainView.builder.Select_Table("Device_Info", where_cmd);
                        DataRow   dr          = dt_machine.Rows[0];
                        if (dr[3].ToString() == "溢流缸")
                        {
                            if (machine_num > 65)
                            {
                                MessageBox.Show("超过最大限制,请联系厂家升级!");
                            }
                            YiLiuGang_Item item = new YiLiuGang_Item();
                            item.MyClick += new EventHandler(Click_Yiliu);
                            item.Set_Title(dr[0].ToString());
                            ViewCaoZuo.Object_Position(0 + ((j - 1) % 4) * 0.25, 0.01 + ((j - 1) / 4) * 0.31, 0.24, 0.3, item, tabControl1.TabPages[i].Controls);
                        }

                        if (dr[3].ToString() == "气流缸")
                        {
                            if (machine_num > 65)
                            {
                                MessageBox.Show("超过最大限制,请联系厂家升级!");
                            }
                            QiLiuGang item = new QiLiuGang();
                            item.Set_Title(dr[0].ToString());
                            item.MyClick += new EventHandler(Click_Qiliu);
                            ViewCaoZuo.Object_Position(0 + ((j - 1) % 4) * 0.25, 0.01 + ((j - 1) / 4) * 0.31, 0.24, 0.3, item, tabControl1.TabPages[i].Controls);
                        }
                    }
                    catch { }
                }
            }
        }