示例#1
0
        /// <summary>
        /// read MD command
        /// </summary>
        /// <param name="get_command">received command</param>
        /// <param name="time_stamp">timestamp data</param>
        /// <param name="distances">distance data</param>
        /// <returns>is successful</returns>
        public static bool MD(string get_command, ref long time_stamp, ref List <long> distances)
        {
            distances.Clear();
            string[] split_command = get_command.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);

            if (!split_command[0].StartsWith("MD"))
            {
                return(false);
            }

            if (split_command[1].StartsWith("00"))
            {
                return(true);
            }
            else if (split_command[1].StartsWith("99"))
            {
                time_stamp = SCIP_Reader.decode(split_command[2], 4);
                distance_data(split_command, 3, ref distances);
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#2
0
        /// <summary>
        /// read distance data
        /// </summary>
        /// <param name="lines"></param>
        /// <param name="start_line"></param>
        /// <returns></returns>
        public static bool distance_data(string[] lines, int start_line, ref List <long> distances)
        {
            StringBuilder sb = new StringBuilder();

            for (int i = start_line; i < lines.Length; ++i)
            {
                sb.Append(lines[i].Substring(0, lines[i].Length - 1));
            }
            return(SCIP_Reader.decode_array(sb.ToString(), 3, ref distances));
        }