Esempio n. 1
0
        /// <summary>
        /// Invoke this repeatedly to get each row of data from the PCM.
        /// </summary>
        /// <returns></returns>
        public async Task <string[]> GetNextRow()
        {
            LogRowParser row = new LogRowParser(this.profile);

#if FAST_LOGGING
            if (DateTime.Now.Subtract(lastRequestTime) > TimeSpan.FromSeconds(2))
            {
                await this.vehicle.ForceSendToolPresentNotification();
            }
#endif
#if !FAST_LOGGING
            if (!await this.vehicle.RequestDpids(this.dpids))
            {
                return(null);
            }
#endif

            while (!row.IsComplete)
            {
                RawLogData rawData = await this.vehicle.ReadLogData();

                if (rawData == null)
                {
                    return(null);
                }

                row.ParseData(rawData);
            }

            return(row.Evaluate());
        }
Esempio n. 2
0
        /// <summary>
        /// Invoke this repeatedly to get each row of data from the PCM.
        /// </summary>
        /// <returns></returns>
        public async Task <IEnumerable <string> > GetNextRow()
        {
            LogRowParser row = new LogRowParser(this.profileAndMath.Profile);

#if FAST_LOGGING
//            if (DateTime.Now.Subtract(lastRequestTime) > TimeSpan.FromSeconds(2))
            {
                await this.vehicle.ForceSendToolPresentNotification();
            }
#endif
#if !FAST_LOGGING
            if (!await this.vehicle.RequestDpids(this.dpids))
            {
                return(null);
            }
#endif

            while (!row.IsComplete)
            {
                RawLogData rawData = await this.vehicle.ReadLogData();

                if (rawData == null)
                {
                    return(null);
                }

                row.ParseData(rawData);
            }

            DpidValues dpidValues = row.Evaluate();

            IEnumerable <string> mathValues = this.profileAndMath.MathValueProcessor.GetMathValues(dpidValues);

            return(dpidValues
                   .Select(x => x.Value.ValueAsString)
                   .Concat(mathValues)
                   .ToArray());
        }