Esempio n. 1
0
 /// <summary>
 /// Sets Body for variable action Traci message
 /// </summary>
 protected override void SetBody()
 {
     try
     {
         _commandBody = new List <byte>();
         _commandBody.Add((byte)_variableName);
         _commandBody = TraciDataHelper.AddToByteList(_commandBody, TraciDataHelper.CreateTraciString(_variableValue));
     }
     catch (Exception ex)
     {
         throw new SumoControllerException("Error setting body of Traci variable message", ex);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Creates the Traci message body
        /// </summary>
        /// <returns>Traci message body in bytes</returns>
        private List <byte> BuildMessageBody()
        {
            try
            {
                List <byte> sectionBytes = new List <byte>();
                foreach (KeyValuePair <TraciConstants.Command, List <byte> > command in _commandQueue)
                {
                    sectionBytes = TraciDataHelper.AddToByteList(sectionBytes, BuildCommandBytes(command));
                }

                return(sectionBytes);
            }
            catch (Exception ex)
            {
                throw new SumoControllerException("Error buiding Traci Message body", ex);
            }
        }