using System; using System.ComponentModel; using System.Data; using System.Drawing; using System.Windows.Forms; using AGVSystem.Cls; using AGVSystem.Properties; namespace AGVSystem { // Token: 0x02000015 RID: 21 public partial class frm_card : Form { // Token: 0x0600011A RID: 282 RVA: 0x00020BA8 File Offset: 0x0001EDA8 public frm_card() { this.InitializeComponent(); this.l1[0] = this.lab1; this.l1[1] = this.lab2; this.l1[2] = this.lab3; this.l1[3] = this.lab4; this.l1[4] = this.lab5; this.l1[5] = this.lab6; this.l1[6] = this.lab7; this.l1[7] = this.lab8; this.l1[8] = this.lab9; this.l1[9] = this.lab10; this.l1[10] = this.lab11; this.l1[11] = this.lab12; this.l1[12] = this.lab13; this.l1[13] = this.lab14; this.l1[14] = this.lab15; this.l1[15] = this.lab16; this.l1[16] = this.lab17; this.l1[17] = this.lab18; this.l1[18] = this.lab19; this.l1[19] = this.lab20; this.l1[20] = this.lab21; this.l1[21] = this.lab22; this.l1[22] = this.lab23; this.l1[23] = this.lab24; this.l1[24] = this.lab25; this.l1[25] = this.lab26; this.l1[26] = this.lab27; this.l1[27] = this.lab28; this.l1[28] = this.lab29; this.l1[29] = this.lab30; this.l1[30] = this.lab31; this.l1[31] = this.lab32; this.pbox1[0] = this.pictureBox1_1; this.pbox1[1] = this.pictureBox1_2; this.pbox1[2] = this.pictureBox1_3; this.pbox1[3] = this.pictureBox1_4; this.pbox1[4] = this.pictureBox1_5; this.pbox1[5] = this.pictureBox1_6; this.pbox1[6] = this.pictureBox1_7; this.pbox1[7] = this.pictureBox1_8; this.pbox1[8] = this.pictureBox1_9; this.pbox1[9] = this.pictureBox1_10; this.pbox1[10] = this.pictureBox1_11; this.pbox1[11] = this.pictureBox1_12; this.pbox1[12] = this.pictureBox1_13; this.pbox1[13] = this.pictureBox1_14; this.pbox1[14] = this.pictureBox1_15; this.pbox1[15] = this.pictureBox1_16; this.pbox1[16] = this.pictureBox1_17; this.pbox1[17] = this.pictureBox1_18; this.pbox1[18] = this.pictureBox1_19; this.pbox1[19] = this.pictureBox1_20; this.pbox1[20] = this.pictureBox1_21; this.pbox1[21] = this.pictureBox1_22; this.pbox1[22] = this.pictureBox1_23; this.pbox1[23] = this.pictureBox1_24; this.pbox1[24] = this.pictureBox1_25; this.pbox1[25] = this.pictureBox1_26; this.pbox1[26] = this.pictureBox1_27; this.pbox1[27] = this.pictureBox1_28; this.pbox1[28] = this.pictureBox1_29; this.pbox1[29] = this.pictureBox1_30; this.pbox1[30] = this.pictureBox1_31; this.pbox1[31] = this.pictureBox1_32; this.pbox1[16].Enabled = false; this.pbox1[17].Enabled = false; this.pbox1[18].Enabled = false; this.pbox1[19].Enabled = false; this.pbox1[20].Enabled = false; this.pbox1[21].Enabled = false; this.pbox1[22].Enabled = false; this.pbox1[23].Enabled = false; this.pbox1[24].Enabled = false; this.pbox1[25].Enabled = false; this.pbox1[26].Enabled = false; this.pbox1[27].Enabled = false; this.pbox1[28].Enabled = false; this.pbox1[29].Enabled = false; this.pbox1[30].Enabled = false; this.pbox1[31].Enabled = false; ClsDBConn_sql clsDBConn_sql = new ClsDBConn_sql(); DataSet dataSet = new DataSet(); bool flag = Param.Card1_Interval > 0; if (flag) { this.checkBox1.Checked = true; dataSet = clsDBConn_sql.connDt("SELECT [ID] ,[CLASS],[BIT] ,[REMARK] FROM [IO_CARD] where ID='CARD0' ORDER BY[CLASS], [BIT]"); int num = 0; int count = dataSet.Tables[0].Rows.Count; foreach (object obj in dataSet.Tables[0].Rows) { DataRow dataRow = (DataRow)obj; bool flag2 = num < 32; if (flag2) { this.l1[num].Text = dataRow[3].ToString(); num++; } } this.timer1.Interval = Param.Card1_Interval + 10; this.timer1.Enabled = true; Param.card1.Output1 = 0; string text = Convert.ToString(Param.card1.Output1, 2).PadLeft(8, '0'); for (int i = 0; i < 8; i++) { bool flag3 = text.Substring(7 - i, 1) == "0"; if (flag3) { this.pbox1[16 + i].BackgroundImage = Resources.ledLow; } else { this.pbox1[16 + i].BackgroundImage = Resources.ledHigh; } } text = Convert.ToString(Param.card1.Output2, 2).PadLeft(8, '0'); for (int j = 0; j < 8; j++) { bool flag4 = text.Substring(7 - j, 1) == "0"; if (flag4) { this.pbox1[24 + j].BackgroundImage = Resources.ledLow; } else { this.pbox1[24 + j].BackgroundImage = Resources.ledHigh; } } for (int k = 0; k < 16; k++) { this.pbox1[16 + k].Click += this.picBox1_Click; } } this.l2[0] = this.label75; this.l2[1] = this.label74; this.l2[2] = this.label73; this.l2[3] = this.label72; this.l2[4] = this.label71; this.l2[5] = this.label70; this.l2[6] = this.label69; this.l2[7] = this.label68; this.l2[8] = this.label67; this.l2[9] = this.label66; this.l2[10] = this.label65; this.l2[11] = this.label64; this.l2[12] = this.label63; this.l2[13] = this.label62; this.l2[14] = this.label61; this.l2[15] = this.label60; this.l2[16] = this.label33; this.l2[17] = this.label32; this.l2[18] = this.label31; this.l2[19] = this.label30; this.l2[20] = this.label29; this.l2[21] = this.label28; this.l2[22] = this.label27; this.l2[23] = this.label26; this.l2[24] = this.label25; this.l2[25] = this.label24; this.l2[26] = this.label23; this.l2[27] = this.label22; this.l2[28] = this.label21; this.l2[29] = this.label20; this.l2[30] = this.label19; this.l2[31] = this.label18; this.pbox2[0] = this.pictureBox32; this.pbox2[1] = this.pictureBox31; this.pbox2[2] = this.pictureBox30; this.pbox2[3] = this.pictureBox29; this.pbox2[4] = this.pictureBox28; this.pbox2[5] = this.pictureBox27; this.pbox2[6] = this.pictureBox26; this.pbox2[7] = this.pictureBox25; this.pbox2[8] = this.pictureBox24; this.pbox2[9] = this.pictureBox23; this.pbox2[10] = this.pictureBox22; this.pbox2[11] = this.pictureBox21; this.pbox2[12] = this.pictureBox20; this.pbox2[13] = this.pictureBox19; this.pbox2[14] = this.pictureBox18; this.pbox2[15] = this.pictureBox17; this.pbox2[16] = this.pictureBox16; this.pbox2[17] = this.pictureBox15; this.pbox2[18] = this.pictureBox14; this.pbox2[19] = this.pictureBox13; this.pbox2[20] = this.pictureBox12; this.pbox2[21] = this.pictureBox11; this.pbox2[22] = this.pictureBox10; this.pbox2[23] = this.pictureBox9; this.pbox2[24] = this.pictureBox8; this.pbox2[25] = this.pictureBox7; this.pbox2[26] = this.pictureBox6; this.pbox2[27] = this.pictureBox5; this.pbox2[28] = this.pictureBox4; this.pbox2[29] = this.pictureBox3; this.pbox2[30] = this.pictureBox2; this.pbox2[31] = this.pictureBox1; bool flag5 = dataSet.Tables.Count > 0; if (flag5) { dataSet.Tables.Clear(); } bool flag6 = Param.Card2_Interval > 0; if (flag6) { this.checkBox2.Checked = true; dataSet = clsDBConn_sql.connDt("SELECT [ID] ,[CLASS],[BIT] ,[REMARK] FROM [IO_CARD] where ID='CARD1' ORDER BY[CLASS], [BIT]"); int num2 = 0; foreach (object obj2 in dataSet.Tables[0].Rows) { DataRow dataRow2 = (DataRow)obj2; this.l2[num2].Text = dataRow2[3].ToString(); num2++; } this.timer2.Interval = Param.Card2_Interval + 10; this.timer2.Enabled = true; string text2 = Convert.ToString(Param.card2.Output1, 2).PadLeft(8, '0'); for (int l = 0; l < 8; l++) { bool flag7 = text2.Substring(7 - l, 1) == "0"; if (flag7) { this.pbox2[16 + l].BackgroundImage = Resources.ledLow; } else { this.pbox2[16 + l].BackgroundImage = Resources.ledHigh; } } text2 = Convert.ToString(Param.card2.Output2, 2).PadLeft(8, '0'); for (int m = 0; m < 8; m++) { bool flag8 = text2.Substring(7 - m, 1) == "0"; if (flag8) { this.pbox2[24 + m].BackgroundImage = Resources.ledLow; } else { this.pbox2[24 + m].BackgroundImage = Resources.ledHigh; } } for (int n = 0; n < 16; n++) { this.pbox2[16 + n].Click += this.picBox2_Click; } } } // Token: 0x0600011B RID: 283 RVA: 0x000218CC File Offset: 0x0001FACC private void picBox1_Click(object sender, EventArgs e) { PictureBox pictureBox = (PictureBox)sender; bool flag = Convert.ToInt16(pictureBox.Tag) < 9; if (flag) { string text = Convert.ToString(Param.card1.Output1, 2).PadLeft(8, '0'); text = text.Substring((int)(7 - (Convert.ToInt16(pictureBox.Tag) - 1)), 1); bool flag2 = text == "0"; if (flag2) { Param.card1.WriteBit(0, (int)(Convert.ToInt16(pictureBox.Tag) - 1), 1); pictureBox.BackgroundImage = Resources.ledHigh; } else { Param.card1.WriteBit(0, (int)(Convert.ToInt16(pictureBox.Tag) - 1), 0); pictureBox.BackgroundImage = Resources.ledLow; } } else { string text = Convert.ToString(Param.card1.Output2, 2).PadLeft(8, '0'); text = text.Substring((int)(7 - (Convert.ToInt16(pictureBox.Tag) - 9)), 1); bool flag3 = text == "0"; if (flag3) { Param.card1.WriteBit(1, (int)(Convert.ToInt16(pictureBox.Tag) - 9), 1); pictureBox.BackgroundImage = Resources.ledHigh; } else { Param.card1.WriteBit(1, (int)(Convert.ToInt16(pictureBox.Tag) - 9), 0); pictureBox.BackgroundImage = Resources.ledLow; } } } // Token: 0x0600011C RID: 284 RVA: 0x00021A28 File Offset: 0x0001FC28 private void picBox2_Click(object sender, EventArgs e) { PictureBox pictureBox = (PictureBox)sender; bool flag = Convert.ToInt16(pictureBox.Tag) < 9; if (flag) { string text = Convert.ToString(Param.card2.Output1, 2).PadLeft(8, '0'); text = text.Substring((int)(7 - (Convert.ToInt16(pictureBox.Tag) - 1)), 1); bool flag2 = text == "0"; if (flag2) { Param.card2.WriteBit(0, (int)(7 - (Convert.ToInt16(pictureBox.Tag) - 1)), 1); pictureBox.BackgroundImage = Resources.ledHigh; } else { Param.card2.WriteBit(0, (int)(7 - (Convert.ToInt16(pictureBox.Tag) - 1)), 0); pictureBox.BackgroundImage = Resources.ledLow; } } else { string text = Convert.ToString(Param.card2.Output2, 2).PadLeft(8, '0'); text = text.Substring((int)(7 - (Convert.ToInt16(pictureBox.Tag) - 9)), 1); bool flag3 = text == "0"; if (flag3) { Param.card2.WriteBit(0, (int)(7 - (Convert.ToInt16(pictureBox.Tag) - 9)), 1); pictureBox.BackgroundImage = Resources.ledHigh; } else { Param.card2.WriteBit(0, (int)(7 - (Convert.ToInt16(pictureBox.Tag) - 9)), 0); pictureBox.BackgroundImage = Resources.ledLow; } } } // Token: 0x0600011D RID: 285 RVA: 0x00021B8C File Offset: 0x0001FD8C private void timer1_Tick(object sender, EventArgs e) { this.temp = Convert.ToString(Param.card1.Input1, 2).PadLeft(8, '0'); for (int i = 0; i < 8; i++) { bool flag = this.temp.Substring(7 - i, 1) == "0"; if (flag) { this.pbox1[i].BackgroundImage = Resources.ledLow; } else { this.pbox1[i].BackgroundImage = Resources.ledHigh; } } this.temp = Convert.ToString(Param.card1.Input2, 2).PadLeft(8, '0'); for (int j = 0; j < 8; j++) { bool flag2 = this.temp.Substring(7 - j, 1) == "0"; if (flag2) { this.pbox1[8 + j].BackgroundImage = Resources.ledLow; } else { this.pbox1[8 + j].BackgroundImage = Resources.ledHigh; } } } // Token: 0x0600011E RID: 286 RVA: 0x00021C8C File Offset: 0x0001FE8C private void timer2_Tick(object sender, EventArgs e) { this.temp2 = Convert.ToString(Param.card2.Input1, 2).PadLeft(8, '0'); for (int i = 0; i < 8; i++) { bool flag = this.temp2.Substring(7 - i, 1) == "0"; if (flag) { this.pbox2[i].BackgroundImage = Resources.ledLow; } else { this.pbox2[i].BackgroundImage = Resources.ledHigh; } } this.temp2 = Convert.ToString(Param.card2.Input2, 2).PadLeft(8, '0'); for (int j = 0; j < 8; j++) { bool flag2 = this.temp2.Substring(7 - j, 1) == "0"; if (flag2) { this.pbox2[8 + j].BackgroundImage = Resources.ledLow; } else { this.pbox2[8 + j].BackgroundImage = Resources.ledHigh; } } } // Token: 0x0600011F RID: 287 RVA: 0x00021D8C File Offset: 0x0001FF8C private void frm_card_FormClosed(object sender, FormClosedEventArgs e) { mainfrm.frm_card1 = null; } // Token: 0x06000120 RID: 288 RVA: 0x00021D98 File Offset: 0x0001FF98 private void checkBox4_CheckedChanged(object sender, EventArgs e) { bool @checked = this.checkBox4.Checked; if (@checked) { this.pbox1[16].Enabled = true; this.pbox1[17].Enabled = true; this.pbox1[18].Enabled = true; this.pbox1[19].Enabled = true; this.pbox1[20].Enabled = true; this.pbox1[21].Enabled = true; this.pbox1[22].Enabled = true; this.pbox1[23].Enabled = true; this.pbox1[24].Enabled = true; this.pbox1[25].Enabled = true; this.pbox1[26].Enabled = true; this.pbox1[27].Enabled = true; this.pbox1[28].Enabled = true; this.pbox1[29].Enabled = true; this.pbox1[30].Enabled = true; this.pbox1[31].Enabled = true; } else { this.pbox1[16].Enabled = false; this.pbox1[17].Enabled = false; this.pbox1[18].Enabled = false; this.pbox1[19].Enabled = false; this.pbox1[20].Enabled = false; this.pbox1[21].Enabled = false; this.pbox1[22].Enabled = false; this.pbox1[23].Enabled = false; this.pbox1[24].Enabled = false; this.pbox1[25].Enabled = false; this.pbox1[26].Enabled = false; this.pbox1[27].Enabled = false; this.pbox1[28].Enabled = false; this.pbox1[29].Enabled = false; this.pbox1[30].Enabled = false; this.pbox1[31].Enabled = false; } } // Token: 0x0400021B RID: 539 private Label[] l1 = new Label[32]; // Token: 0x0400021C RID: 540 private Label[] l2 = new Label[32]; // Token: 0x0400021D RID: 541 private Label[] l3 = new Label[32]; // Token: 0x0400021E RID: 542 private PictureBox[] pbox1 = new PictureBox[32]; // Token: 0x0400021F RID: 543 private PictureBox[] pbox2 = new PictureBox[32]; // Token: 0x04000220 RID: 544 private PictureBox[] pbox3 = new PictureBox[32]; // Token: 0x04000221 RID: 545 private string temp; // Token: 0x04000222 RID: 546 private string temp2; } }