示例#1
0
        public void Send(string instanceTag, TesiraCommand command, uint[] indexes)
        {
            var message = FormatBaseMessage(instanceTag, command);

            message = indexes.Aggregate(message, (current, index) => current + " " + index);
            _client.Send(message);
        }
示例#2
0
        public void Send(string instanceTag, TesiraCommand command, uint[] indexes, bool value)
        {
            var message = FormatBaseMessage(instanceTag, command);

            message = indexes.Aggregate(message, (current, index) => current + " " + index);
            message = message + " " + value.ToString().ToLower();
            _client.Send(message);
        }
示例#3
0
        public void Send(string instanceTag, TesiraCommand command, TesiraAttributeCode attributeCode, uint[] indexes, double value)
        {
            var message = FormatBaseMessage(instanceTag, command, attributeCode);

            message = indexes.Aggregate(message, (current, index) => current + " " + index);
            message = message + " " + value.ToString("F1");
            _client.Send(message);
        }
示例#4
0
        public static string ToCommandString(this TesiraCommand command)
        {
            var str = command.ToString();

            return(str.Substring(0, 1).ToLower() + str.Substring(1, str.Length - 1));
        }
示例#5
0
 public void Send(string instanceTag, TesiraCommand command, TesiraAttributeCode attributeCode)
 {
     _client.Send(FormatBaseMessage(instanceTag, command, attributeCode));
 }
示例#6
0
 internal static string FormatBaseMessage(string instanceTag, TesiraCommand command)
 {
     return(string.Format("{0} {1}", instanceTag, command.ToCommandString()));
 }
示例#7
0
 internal static string FormatBaseMessage(string instanceTag, TesiraCommand command, TesiraAttributeCode attributeCode)
 {
     return(string.Format("{0} {1} {2}", instanceTag, command.ToString().ToLower(), attributeCode.ToCommandString()));
 }