Esempio n. 1
0
        /// <summary>
        ///  Unpack received logging data so it represent real values according
        /// to the configuration in the entry
        /// </summary>
        public void UnpackLogData(byte[] logData, uint timestamp)
        {
            var eventData = new LogDataReceivedEventArgs(timestamp);
            var index     = 0;

            foreach (var variable in _logVariables)
            {
                var targetSize = LogTocElement.GetSizeFromId(variable.FetchAsId);
                var toDecode   = new byte[targetSize];
                Array.Copy(logData, index, toDecode, 0, targetSize);
                var value = LogTocElement.Unpack(variable.FetchAsId, toDecode);
                index += targetSize;
                eventData.AddVariable(variable.Name, value);
            }
            LogDataReceived?.Invoke(this, eventData);
        }
Esempio n. 2
0
 private protected void Logging(string log)
 {
     Task.Run(() => LogDataReceived?.Invoke(log));
 }
        private void RaiseLogDataReceived(LogLevel level, string data, bool isSummary)
        {
            var args = new LogDataEventArgs(level, data, isSummary);

            LogDataReceived?.Invoke(this, args);
        }