public void DataMapping2Control_STP313Packet(Ultrasonic_Data_Packet dat, ref Label[] tx) { tx[0].Text = (dat.Distance1).ToString("F2"); tx[1].Text = (dat.Distance2).ToString("F2"); tx[2].Text = (dat.Width).ToString("F2"); tx[3].Text = (dat.Level).ToString("F2"); if (dat.status == 1) { tx[4].Text = SensingStatus[0]; } else if (dat.status == 2) { tx[4].Text = SensingStatus[1]; } else if (dat.status == 4) { tx[4].Text = SensingStatus[2]; } else if (dat.status == 8) { tx[4].Text = SensingStatus[3]; } else if (dat.status == 16) { tx[4].Text = SensingStatus[4]; } else { tx[4].Text = "正常"; } }
public void DataMapping2Control_STP318Packet(Ultrasonic_Data_Packet dat, ref Label tx) { tx.Text = (dat.Distance1).ToString("F2"); }