private void button1_Click(object sender, EventArgs e) { byte commandAddr = (byte)((comboBox1.Text == "X轴") ? 0x00 : 0x01);; CmdSleep ci = new CmdSleep(); addrc = ci.GetWaitAxisResetCmd(commandAddr); richTextBox1.Text = DataChange.byteToHexStr(addrc); }
public void GetWaitAxisResetCmdTest() { //AA 05 01 C2 01 C7 CmdSleep cf = new CmdSleep(); byte[] ret = cf.GetWaitAxisResetCmd(0x01); Assert.AreEqual(ret.Count(), 6); Assert.AreEqual(ret[5], 0xC7); Assert.AreEqual(ret[0], 0xAA); Assert.AreEqual(ret[1], 0x05); Assert.AreEqual(ret[2], 0x01); Assert.AreEqual(ret[3], 0xC2); }