示例#1
0
 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();
 }
示例#2
0
        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());
        }
示例#3
0
        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());
        }