private void button25_Click(object sender, EventArgs e) { DataCard.getinstance().Open(); if (DataCard.getinstance().IsOpen()) { button27.BackColor = Color.Green; textBox5.Text = DataCard.getinstance().GetInstanceDiscription(); } }
private void button17_Click(object sender, EventArgs e) { if (button17.BackColor == Color.Red) { DataCard.getinstance().WriteInBits(7, 1); button17.BackColor = Color.Green; } else { DataCard.getinstance().WriteInBits(7, 0); button17.BackColor = Color.Red; } }
private void button28_Click(object sender, EventArgs e) { int data; data = DataCard.getinstance().ReadByte(); textBox6.Text = data.ToString(); bool[] indexnum = new bool[8]; for (int i = 0; i < 8; i++) { indexnum[i] = DataCard.getinstance().ReadInBits(i); } button9.BackColor = indexnum[0] ? Color.Green : Color.Red; button10.BackColor = indexnum[1] ? Color.Green : Color.Red; button11.BackColor = indexnum[2] ? Color.Green : Color.Red; button12.BackColor = indexnum[3] ? Color.Green : Color.Red; button13.BackColor = indexnum[4] ? Color.Green : Color.Red; button14.BackColor = indexnum[5] ? Color.Green : Color.Red; button15.BackColor = indexnum[6] ? Color.Green : Color.Red; button16.BackColor = indexnum[7] ? Color.Green : Color.Red; }
private void button26_Click(object sender, EventArgs e) { DataCard.getinstance().SetDeviceDiscription(textBox4.Text); button27.BackColor = Color.Red; }
public void TryInitializeDataCard() { DataCard.getinstance().Open(); DataCardIsOpen = DataCard.getinstance().IsOpen(); DataCardDiscription = DataCard.getinstance().GetInstanceDiscription(); }