public void Display(SerialPort com, CustomerDisplayData data) { string str = string.Format(" Money: {0}" + Environment.NewLine + " Pay: {1}" + Environment.NewLine + "Change: {2}", data.Total, data.Pay, data.Change); CLS(com); SendToDisplay(com, str); }
public void Display(SerialPort com, CustomerDisplayData data) { string str = ""; switch (data.StatusLight) { case 1: str = data.Price; break; case 2: str = data.Total; break; case 3: str = data.Pay; break; case 4: str = data.Change; break; } CLS(com); byte[] status = strToToHexByte("1B733" + data.StatusLight); //状态灯 com.Write(status, 0, status.Length); //SendToDisplay(com, "1B7331");//状态灯 //com.Write("1B7331".ToCharArray(), 0, 6); SendToDisplay(com, str);//数据 }