public string CreateCommand(GfxCommand command, params object[] parameters) { StringBuilder sb = new StringBuilder(); sb.Append(command.ToString()); sb.Append(":"); if (parameters.Length > 0) { if (parameters.Length > 1) { for (int i = 0; i < parameters.Length - 1; ++i) { sb.Append(parameters[i].ToString()); sb.Append(","); } } sb.Append(parameters.Last().ToString()); } return sb.ToString(); }
public string CreateCommand(GfxCommand command, params object[] parameters) { StringBuilder sb = new StringBuilder(); sb.Append(command.ToString()); sb.Append(":"); if (parameters.Length > 0) { if (parameters.Length > 1) { for (int i = 0; i < parameters.Length - 1; ++i) { sb.Append(parameters[i].ToString()); sb.Append(","); } } sb.Append(parameters.Last().ToString()); } return(sb.ToString()); }
public void ExecGfxCommand(GfxCommand command, params object[] parameters) { StringBuilder sb = new StringBuilder(); sb.Append(command.ToString()); sb.Append(":"); if (parameters.Length > 0) { if (parameters.Length > 1) { for (int i = 0; i < parameters.Length - 1; ++i) { sb.Append(parameters[i].ToString()); sb.Append(","); } } sb.Append(parameters.Last().ToString()); } mSerialPort.WriteLine(sb.ToString()); }